程序有问题,在140.4、139.8、132等点处有异常值,请教一下大家怎么改,应该是Y=…那一步的式子有问题,谢谢
%T$>E7]! Gx$m"Jeq\ Y值为负的那几个点是异常值
%~:\f#6 MhA4C 8 clc
8o+:|V~X clear
2 T} >9X close all
4!Radl3` nx = 0:0.6:150;
\)5mO 8w n = length(nx)-1;
sSfP.R figure
7vXP|8j xz = [];
J-/w{T8: yz = [];
C$0u-Nx8 for ii = 1:n
H
~3.F f=300;
L{VnsY V h=150-nx(ii);
vv&< 7[ b=atan(h/f);
mxZ+r#|di d=(b/pi)*180
omg#[ syms c
lusUmFm'* Y=solve(sin(c-b)-1.494*sin(3*c-pi)==0,c);
Q3%] C=double(Y);
E[#VWM
I e=(C/pi)*180;
V'#R1 x"3 x=0:0.1:0.6;
EVLL,x.~:z y=(0.6-x)*tan(C);
TrzAgNt xz = [xz x+nx(ii)]
fZpi+I yz = [yz y];
g%Tokl plot(xz,yz,'k-')
Mi#i 3y( hold on
tl /i pause(0.01)
OvQzMXU^I end
'k]~Q{K$ y;CX)!8 |hj!NhBe iS)-25M' 4Cu\|"5)