MATLAB: How to convert data points to time

sampling ratetime

Hi, so I have this data and I want to convert the x-axis to time. Right now the x-axis represents the data point. Please help.

Best Answer

Make a datetime or duration array and call plot with that as the first data input.
v = 1:10;
x = datetime('today')+days(v);
y = v.^2;
plot(x, y)
t = hours(v);
plot(t, y)