how to plot a specific column of a matrix

335 views (last 30 days)
Amin
Amin on 24 Jul 2014
Answered: Michael Haderlein on 24 Jul 2014
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.

Answers (2)

Mischa Kim
Mischa Kim on 24 Jul 2014
Edited: Mischa Kim on 24 Jul 2014
Amin, use
plot(mymat(:,2))
where mymat is the matrix.
  5 Comments
Amin
Amin on 24 Jul 2014
unfortunately not ,
all i need is just s.th like this image
Amin
Amin on 24 Jul 2014
and what i got from ur cmnd is like this

Sign in to comment.


Michael Haderlein
Michael Haderlein on 24 Jul 2014
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

Categories

Find more on 2-D and 3-D Plots 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!