필터 지우기
필터 지우기

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