필터 지우기
필터 지우기

for文でのデータ蓄積

조회 수: 7 (최근 30일)
Daichi Saitou
Daichi Saitou 2020년 2월 3일
편집: Daichi Saitou 2020년 2월 3일
for j=1:681
tic
t=abs(A2(j));
z=A(j);
n=angles(j);
if t<5
c='.b';
else
c='.r';
end
end
polarplot(n,z,c);
rlim([0 5000])
thetalim([-120 120])
rtickformat('%g mm')
thetatickformat('degrees')
rtickangle(-30)
ax = gca;
ax.ThetaZeroLocation = 'top';
drawnow
tok
for文で蓄積したデータを一気にplotしたいです。これだと、最後の点だけplotしてしまいます。

답변 (1개)

Takumi
Takumi 2020년 2월 3일
plotを重ねたいときはfigureをhold onしてください.こんな感じです
for j=1:681
tic
t=abs(A2(j));
z=A(j);
n=angles(j);
if t<5
c='.b';
else
c='.r';
end
polarplot(n,z,c);
hold on
rlim([0 5000])
thetalim([-120 120])
rtickformat('%g mm')
thetatickformat('degrees')
rtickangle(-30)
ax = gca;
ax.ThetaZeroLocation = 'top';
drawnow
toc
end
ところで,この方法だと計算に時間がかかります.for文を使わない方法にもチャレンジしてみてください.
  댓글 수: 1
Daichi Saitou
Daichi Saitou 2020년 2월 3일
回答ありがとうございます。確かに時間がかかりますね。他の方法も試してみます。

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

카테고리

Help CenterFile Exchange에서 極座標プロット에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!