matlab求助,Conversion to double from sym is not possible. 15
symsNupazthetaxbr;N=2000;b=1;u=4*pi*10^(-7);p=1;a=40;theta=0.2;r=-b*cos(x)+sqrt(a^2-b...
syms N u p a z theta x b r;
N=2000;
b=1;
u=4*pi*10^(-7);
p=1;
a=40;
theta=0.2;
r=-b*cos(x)+sqrt(a^2-b^2*(sin(x)^2));
y1=N*u*p*a/(4*pi)*(r-z*sin(theta)*cos(x))/(((-z*sin(theta)+r*cos(x))^2+(r*sin(x))^2+z^2)^(3/2));
y2=int(y1,x,0,2*pi);
e=-diff(y2,z);
t=-100:1:-1;
y3=subs(e,z,t); (1)
plot(t,y3,'r') (2)
hold on
t=1:1:100;
y4=subs(e,z,t);
plot(t,y4,'r')
plot(0,0,'r*')
程序为什么运行无结果输出?逐条运行直到(1)处都是好的,到(2)就显示
??? Error using ==> plot
Conversion to double from sym is not possible.
这是什么原因呢?麻烦帮忙改一下,万分感谢!! 展开
N=2000;
b=1;
u=4*pi*10^(-7);
p=1;
a=40;
theta=0.2;
r=-b*cos(x)+sqrt(a^2-b^2*(sin(x)^2));
y1=N*u*p*a/(4*pi)*(r-z*sin(theta)*cos(x))/(((-z*sin(theta)+r*cos(x))^2+(r*sin(x))^2+z^2)^(3/2));
y2=int(y1,x,0,2*pi);
e=-diff(y2,z);
t=-100:1:-1;
y3=subs(e,z,t); (1)
plot(t,y3,'r') (2)
hold on
t=1:1:100;
y4=subs(e,z,t);
plot(t,y4,'r')
plot(0,0,'r*')
程序为什么运行无结果输出?逐条运行直到(1)处都是好的,到(2)就显示
??? Error using ==> plot
Conversion to double from sym is not possible.
这是什么原因呢?麻烦帮忙改一下,万分感谢!! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询