How to plot with 'm' rows and 3 columns?

1 view (last 30 days)
Ara
Ara on 3 Mar 2013
Hi Everyone,
Just a simple question; The data is look like below and I want to plot x(for only x>0.2) as a function of Y and time. Could you please help me?
x y time
0 15 1
0.2 20 3
0.3 25 4
0.1 33 5
0.6 90 6
Thanks,
Ara

Answers (1)

Wayne King
Wayne King on 3 Mar 2013
Edited: Wayne King on 3 Mar 2013
You only have two values here above 0.2 so it's not going to be an interesting plot, but let the matrix be A
A = [0 15 1
0.2 20 3
0.3 25 4
0.1 33 5
0.6 90 6 ];
idx = find(A(:,1)>0.2);
plot3(A(idx,3),A(idx,2),A(idx,1))
or
scatter3(A(idx,3),A(idx,2),A(idx,1))
Or you can simply set the x-values below to 0.2 to NaN for plotting
A(A(:,1) <=0.2) = NaN;
scatter3(A(:,3),A(:,1),A(:,3))
  1 Comment
Ara
Ara on 3 Mar 2013
Thanks for your help. Yes, this one is a sample of my data so it may not interesting to plot these columns as you said. Actually, I am dealing with excel data with 32 columns and 5337 rows. According to my data, when I plot as a 3D are not as clear as 2D. So I am wondering if I can find another way to plot it. And How can I read row corresponding to the row? Another question; 3, 2 and 1 represent as columns? plot3(A(idx,3),A(idx,2),A(idx,1))

Sign in to comment.

Categories

Find more on Line Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!