필터 지우기
필터 지우기

Mark Multiple minimum and maximum value in polarplot

조회 수: 3 (최근 30일)
Arief Yoga Randytama
Arief Yoga Randytama 2021년 7월 16일
댓글: Arief Yoga Randytama 2021년 7월 16일
Hi, I have created the code to plot a data in polar coordinates as such:
theta=deg2rad(0:30:330);
r=[2.14 2.29 2.14 2.00 2.14 2.29 2.14 2.00 2.00 2.57 2.14 2.00];
polarplot(theta([1:end 1]),r([1:end 1]))
ax=gca
ax.ThetaZeroLocation='right'
ax.ThetaDir='counterclockwise'
title('RSR Value of Maximum Water Depth')
Now i want to mark all 3 minimum value of r (2.00) with a red circle, and also the maximum value with a green star. How can i do it? Thanks

채택된 답변

KSSV
KSSV 2021년 7월 16일
theta=deg2rad(0:30:330);
r=[2.14 2.29 2.14 2.00 2.14 2.29 2.14 2.00 2.00 2.57 2.14 2.00];
polarplot(theta([1:end 1]),r([1:end 1])) ;
[val0,idx0] = min(r) ;
[val1,idx1] = max(r) ;
hold on
polarplot(theta(idx0),val0,'*r') ;
polarplot(theta(idx1),val1,'*k') ;
ax=gca ;
ax.ThetaZeroLocation='right' ;
ax.ThetaDir='counterclockwise' ;
title('RSR Value of Maximum Water Depth')
  댓글 수: 1
Arief Yoga Randytama
Arief Yoga Randytama 2021년 7월 16일
Thanks! this works just fine, but i noticed that val0 and idx0 only reads one minimum value of r. Meanwhile, what i intended is mark all the minimum r value, which belongs to 90, 210, and 240 degree. Can it be done? Thanks again.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by