How to plot with 'm' rows and 3 columns?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Wayne King
am 3 Mär. 2013
Bearbeitet: Wayne King
am 3 Mär. 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))
Siehe auch
Kategorien
Mehr zu Line Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!