How to plot with 'm' rows and 3 columns?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Wayne King
il 3 Mar 2013
Modificato: Wayne King
il 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))
Vedere anche
Categorie
Scopri di più su Line Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!