I have a matrix that contains two columns of data. The first column has timestamps given in UNIX time and the second column has a corresponding data set.
I'm trying to plot this DATA with human-readable times on the bottom axis.
I've plotted the raw data, like so:
plot(DATA(:,1), DATA(:,2));
I know there is a timeseries() function in MATLAB, but I can't seem to get it working correctly. I should be able to plot the data, following the MATLAB documentation.
I've tried declaring the first column as a time series:
TS = timeseries(DATA(:,1));
Then I tried plotting the data, like so:
plot(TS, DATA(:,1));
Although this approach seems to make rational sense, I get the following error:
Error using plot Data must be a single matrix Y or a list of pairs X,Y
I also tried to use the addsample() function to append the data to the time series and then plot it.
K = addsample(TS, DATA(:,2));
plot(K);
But doing this produced the following error:
A new sample must be specified either as a structure or by Property-Value pairs.
So how do I plot this time data correctly? Thank you!

timeseriesis the correct function for this, since it uses only the data as input and the equidistant time-steps (although some can be missing). However, if you have arbitrary time points, it will not work as expected. Can you add sample data, i.e. the first four lines ofDATA?