plotting double timeseries - running into problems with plotting a as a proper time series
1 view (last 30 days)
Show older comments
hello!
I am trying to plot a 10x2 double variable. When I looked at the actual variable, it is made up of two columns, the first being time, and the second being the value of my timeseries.
here are my variables:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/474948/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/474953/image.png)
figure;
plot(time, data)
But the figure I get individually plots time and the other 'data' separately, and not as time vs. data.
Can you help me? I have been trying to manually get rid of the one of the columns but it's not sustainable long term.
Thanks!
3 Comments
Adam Danz
on 30 Dec 2020
The shapes of the variables indicate that you have two time series stored in 'data' and the plot should produce two lines.
Perhaps you want
plot(time, data(:,1))
% or
plot(time, data(:,2))
Answers (0)
See Also
Categories
Find more on Teaching Resources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!