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 次查看(过去 30 天)
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.

回答(1 个)

Chunru
Chunru 2022-9-18
编辑:Chunru 2022-9-18
hold on
idx = drag==1;
plot3(h(idx), s(idx), drag(idx), 'r^')
plot3(h(~idx), s(~idx), drag(~idx), 'bo')
  2 个评论
Khush Patel
Khush Patel 2022-9-18
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');

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by