程序有问题,在140.4、139.8、132等点处有异常值,请教一下大家怎么改,应该是Y=…那一步的式子有问题,谢谢
7[-jr;v
#^Dc:1, Y值为负的那几个点是异常值
g[;iVX^1& ru`;cXa, clc
34C
^vBp clear
5Ag>,>kJ6 close all
);h\0w>3 nx = 0:0.6:150;
1V`]sfRK n = length(nx)-1;
<LW|m7 figure
\i-jME(sN xz = [];
bIm$7a`T yz = [];
Xh]\q) for ii = 1:n
2LYd
# !i f=300;
uz4mHyS6 h=150-nx(ii);
?E2k]y6< b=atan(h/f);
LM'` U-/e$ d=(b/pi)*180
7o
z(hO~ syms c
x#0C+cU Y=solve(sin(c-b)-1.494*sin(3*c-pi)==0,c);
ud:?~?j&w C=double(Y);
l1cBY{3QD e=(C/pi)*180;
9L#B"lh x=0:0.1:0.6;
_3p:q. y=(0.6-x)*tan(C);
7IJb$af:; xz = [xz x+nx(ii)]
M{kPEl&Z yz = [yz y];
w#mnGD plot(xz,yz,'k-')
:e@JESlLf hold on
qd|*vE pause(0.01)
;D8Nya>% end
Vd<=
y Dlj=$25 5,AQ~_,'\ <Awx:lw. J+*rjdI