Matlab Error using ==> plot Conversion to double from sym is not possible.clearx=0:0.1:1;syms a;B=2*int((-x*sin(a)+1)./(1+(x.^2)-2*x*cos(a)).^1.5,a,0,pi);plot(x,B)运行后就出现?Error using ==> plotConversion to double from sym is not possible.

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/10 19:16:44
Matlab Error using ==> plot Conversion to double from sym is not possible.clearx=0:0.1:1;syms a;B=2*int((-x*sin(a)+1)./(1+(x.^2)-2*x*cos(a)).^1.5,a,0,pi);plot(x,B)运行后就出现?Error using ==> plotConversion to double from sym is not possible.

Matlab Error using ==> plot Conversion to double from sym is not possible.clearx=0:0.1:1;syms a;B=2*int((-x*sin(a)+1)./(1+(x.^2)-2*x*cos(a)).^1.5,a,0,pi);plot(x,B)运行后就出现?Error using ==> plotConversion to double from sym is not possible.
Matlab Error using ==> plot Conversion to double from sym is not possible.
clear
x=0:0.1:1;
syms a;
B=2*int((-x*sin(a)+1)./(1+(x.^2)-2*x*cos(a)).^1.5,a,0,pi);
plot(x,B)
运行后就出现?Error using ==> plot
Conversion to double from sym is not possible.
大神们怎么改

Matlab Error using ==> plot Conversion to double from sym is not possible.clearx=0:0.1:1;syms a;B=2*int((-x*sin(a)+1)./(1+(x.^2)-2*x*cos(a)).^1.5,a,0,pi);plot(x,B)运行后就出现?Error using ==> plotConversion to double from sym is not possible.
你这个程序语法和函数使用有一些错误,我求解了一下,这个函数使用int也求不出解析解.下面是我用数值解做的,x=1时貌似没有积分值.
f=@(x,a) (-x*sin(a)+1)./(1+(x.^2)-2*x*cos(a)).^1.5;
I=[];
for x=0:0.1:1
I=[I 2.*quad(@(a)f(x,a),0,pi)];
end
x=0:0.1:1;
plot(x,I)