Borrar filtros
Borrar filtros

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 visualización (últimos 30 días)
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.

Respuestas (1)

Chunru
Chunru el 18 de Sept. de 2022
Editada: Chunru el 18 de Sept. de 2022
hold on
idx = drag==1;
plot3(h(idx), s(idx), drag(idx), 'r^')
plot3(h(~idx), s(~idx), drag(~idx), 'bo')
  2 comentarios
Khush Patel
Khush Patel el 18 de Sept. de 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');

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by