【发布时间】:2014-03-15 02:38:00
【问题描述】:
我想在 MATLAB 中从函数 tan(n*theta1) + tan(n*theta2) + tan(n*thetas)= 0 绘制 n 与 theta1;其中 n、theta1 和 theta2 是变量,并且给出了 thetas。谁能指点一下如何做到这一点?
我尝试过使用 ezplot。没用。
接下来,我使用了这段代码,
c = 1;
thetas = pi/4;
for n = 1.01:0.01:3.50
for theta1 = pi/2 : 0.01 : 5*pi/6
for theta2 = 0: 0.01: pi/2
if(tan(n*theta1) + tan(n*theta2) + tan(n*thetas) >= -0.0001 && tan(n*theta1) + tan(n*theta2) + tan(n*thetas) <= 0.0001 && (n*theta1) ~= pi/2 ...
&& (n*theta2) ~= pi/2 && (n*thetas) ~= pi/2)
ns(c) = n;
theta1s(c) = theta1;
theta2s(c) = theta2;
c = c + 1;
end
end
end
end
我尝试使用 plot 命令绘制结果。也没有成功。大多数情况下,对于每个给定的 thetas 值,该图应该是三个不同的曲线。
谁能帮忙?
【问题讨论】:
标签: matlab