MATLAB: Plotting data with timestamps

matlab plot

Hi,
I have some data from a sensor and corresponding timestamps. How do I plot this data? (x axis – timestamps, y-axis – data) plot function gives empty figures. Probably because timestamps cannot be put in a linear scale. I tried semilogx – this also gives empty figures.
How do I do this?
Thanks in advance

Best Answer

Convert from whatever format the timestamps are in to a Matlab representation of dates...with R2014 up, there's the datetime class; prior to that use datenum. See <datetime> for current versions; plot is datetime -aware.