I have data files that look like:
# Date/Time 2021/12/22, 10:52:53 # PonE=0,LsKp=200,LsKi=0,LsKd=250,HsKp=40,HsKi=0,HsKd=130,Sp=800,TDEC=1175137 # # Rel. Time, currentPos, PosPID, currentSpeed, speedPID, Lag, ServoPos 0.00000,4693184,0,0,0,0,4693184 0.00000,4693184,2300,0,368,0,4693184 0.00391,4693185,2300,12,367,0,4693184 : :
I want to import this data and plot it. I want to use the date and time (in this file 2021/12/22, 10:52:53)
as the plot title, and to use the data from the second comment line as a caption (or similar)
In addition I want to plot a horizontal line with the value of TDEC from that same line.
The data after the headers I can read using dlmread I think. The problem is how to handle that comment data. I suspect that textscan might be needed, but as I have never used Octave before, I am struggling to come up with the necessary code.
If it makes things simpler I have some control over the format of the comments and whether (e.g.) the 4th line should be a comment or not.