【发布时间】:2014-10-14 18:42:34
【问题描述】:
我是 matlab 新手,我必须使用增量为 15 的 for 循环作为坐标点。
我试过了
for theta = 0; and(theta <= 360, theta >= 0)
theta +15;
end
和
theta = 0;
for theta = [0:360];
theta = theta+15;
end
第二个是我让它工作的关闭,但它仍然超过 360,第一个似乎更有意义,但它给了我一个错误,说 theta 以前被用作变量。
y12 = sind(theta) + cosd(theta);
y1 = sind(theta);
y2=cosd(theta);
plot(theta,y12)
plot(theta,y1)
plot(theta,y2)
title 'Project 7D - 3 curves(0-2*pi)'
xlabel 'Angle in Radian'
ylabel 'Function Value'
【问题讨论】:
标签: matlab loops for-loop increment