MATLAB: Reading CSV file with time stamped data and Plotting data with Time in the X-axis

cvs fileplotting timestamp data from csvtimestamp data

I have a csv file with data imported from a PLC time stamped to msec. I wanted to use the following "csvread" command to read the data and plot the data with time on the x axis.
Time Data format 12:38:06;865 (HH:MM:SS;FFFF) See attached csv file
Can you please assist me to be able read the timestamp in Matlab and plot the data

Best Answer

[num,txt,raw] = xlsread('Test1.csv');
time = vertcat(txt{2:end,1}) ;
gvpos = num(:,1) ;
vlvlimcm = num(:,2) ;
speedctrl = num(:,3) ;
speed = num(:,4) ;
pidout = num(:,5) ;
%
dn=datenum(time,'HH:MM:SS;FFF');
plot(dn,gvpos)
datetick('x','keepticks','keeplimits')
Related Question