半径1、中心(0,0)の円をy>=0で赤、それ以外を青。ifとforを用いてプロットしたいです。自分で何十回とやってみたのですがどうもうまくいきません。どなたかご助力いただけると幸いです。
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 2 次元および 3 次元プロット en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!