Azzera filtri
Azzera filtri

How do I get Os at drag=0 and Xs for drag=1 on my plot? (code and plot in the description) (plot markers)

1 visualizzazione (ultimi 30 giorni)
I need to plot 3 variables on a 3D plot. I successfully plotted it but now I need plot markers for when drag is 0 and 1. Drag can only be 0 and 1 as you can see from the plot.

Risposte (1)

Chunru
Chunru il 18 Set 2022
Modificato: Chunru il 18 Set 2022
hold on
idx = drag==1;
plot3(h(idx), s(idx), drag(idx), 'r^')
plot3(h(~idx), s(~idx), drag(~idx), 'bo')
  2 Commenti
Khush Patel
Khush Patel il 18 Set 2022
this is what I get. I'm not getting a 3D plot.
here's my code:
h=(h-min(h))/(max(h)-min(h));
s=(s-min(s))/(max(s)-min(s));
%!!--------------------------------
%!!use h for x axis, s for y axis, plot x symbols for drag=1, o symbols
%for drag==0------------
clf
figure
hold on
idx = drag==1;
plot3(h(idx), s(idx), drag(idx), 'r^')
plot3(h(~idx), s(~idx), drag(~idx), 'bo')
xlabel('h'); ylabel('s'); zlabel('drag');

Accedi per commentare.

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Tag

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by