半径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!