plot columns of matrix

17 次查看(过去 30 天)
Filip Jackowski
Filip Jackowski 2019-5-1
suppose I have a 4x100 matrix Ctrack. The four rows each correspond to a different variable, and they change with time from one column to the next. How would I plot it so that on the same plot i have four different curves showing how each variable changes across the different columns?

回答(1 个)

Geoff Hayes
Geoff Hayes 2019-5-1
编辑:Geoff Hayes 2019-5-1
Filip - from plot,
plot(Y) creates a 2-D line plot of the data in Y versus the index of each value.
...
If Y is a matrix, then the plot function plots the columns of Y versus their row number. The x-axis scale ranges from 1 to the number of rows in Y.
In your case, you want to plot the rows of Y versus their column number. So perhaps try transposing the data and do as
plot(Ctrack');

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by