Filter löschen
Filter löschen

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 Ansicht (letzte 30 Tage)
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.

Antworten (1)

Chunru
Chunru am 18 Sep. 2022
Bearbeitet: Chunru am 18 Sep. 2022
hold on
idx = drag==1;
plot3(h(idx), s(idx), drag(idx), 'r^')
plot3(h(~idx), s(~idx), drag(~idx), 'bo')
  2 Kommentare
Khush Patel
Khush Patel am 18 Sep. 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');

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by