半径1、中心(0,0)の円をy>=0で赤、それ以外を青。ifとforを用いてプロットしたいです。自分で何十回とやってみたのですがどうもうまくいきません。どなたかご助力いただけると幸いです。
이전 댓글 표시
for c=0:360
x=cos(deg2rad(c))
y=sin(deg2rad(c))
if y>=0
plot(x,y,'-ro');
else
plot(x,y,'-bx');
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 2 次元および 3 次元プロット에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!