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

1 次查看(过去 30 天)
Ara
Ara 2013-3-3
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

回答(1 个)

Wayne King
Wayne King 2013-3-3
编辑:Wayne King 2013-3-3
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 个评论
Ara
Ara 2013-3-3
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))

请先登录,再进行评论。

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by