How to plot with 'm' rows and 3 columns?
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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))
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!