程序有问题,在140.4、139.8、132等点处有异常值,请教一下大家怎么改,应该是Y=…那一步的式子有问题,谢谢
xw
Qkk z[OEgHI Y值为负的那几个点是异常值
&LYZQ?| 8/v_ uEG clc
PeaD] clear
5S bSz!s`$ close all
0IuU4h5Fr nx = 0:0.6:150;
K)ib{V(50 n = length(nx)-1;
7lu;lAAP figure
u}_q'=<\ xz = [];
<o}t-Bgg yz = [];
tnntHQ&b for ii = 1:n
}e)ltp| f=300;
u"ow?[E h=150-nx(ii);
Dl6zl6q? b=atan(h/f);
9'M({/7y d=(b/pi)*180
QKxuvW syms c
[]NAV Y=solve(sin(c-b)-1.494*sin(3*c-pi)==0,c);
"`zw( C=double(Y);
$MHc4FE[ e=(C/pi)*180;
1'U-n{fD x=0:0.1:0.6;
ga1RMRu+ y=(0.6-x)*tan(C);
:T2K\@ xz = [xz x+nx(ii)]
oT w1w yz = [yz y];
wqsnyP/m plot(xz,yz,'k-')
gnt[l0m hold on
w *0T"hK pause(0.01)
4" @yGXUb end
TkykI ]up:pddIh ~QXNOtVsN -xXM/3g1u Ghz)=3