how to plot a specific column of a matrix

309 次查看(过去 30 天)
hi there , i have a 115340*3 matrix i want to plot just the second column of it, how can i do that ? any help would be appreciated.

回答(2 个)

Mischa Kim
Mischa Kim 2014-7-24
编辑:Mischa Kim 2014-7-24
Amin, use
plot(mymat(:,2))
where mymat is the matrix.
  5 个评论
Amin
Amin 2014-7-24
unfortunately not ,
all i need is just s.th like this image
Amin
Amin 2014-7-24
and what i got from ur cmnd is like this

请先登录,再进行评论。


Michael Haderlein
Michael Haderlein 2014-7-24
That looks as if your data is not sorted. Either you don't plot the lines
plot(...,'.')
or you sort beforehand:
[sort1,ind]=sort(matrix(:,2));
sort2=matrix(ind,3);
plot(sort1,sort2)
Best regards,
Michael

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by