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/07/20 14:34:40
![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.](/uploads/image/z/13802101-61-1.jpg?t=Matlab+Error+using+%3D%3D%3E+plot+Conversion+to+double+from+sym+is+not+possible.clearx%3D0%3A0.1%3A1%3Bsyms+a%3BB%3D2%2Aint%28%28-x%2Asin%28a%29%2B1%29.%2F%281%2B%28x.%5E2%29-2%2Ax%2Acos%28a%29%29.%5E1.5%2Ca%2C0%2Cpi%29%3Bplot%28x%2CB%29%E8%BF%90%E8%A1%8C%E5%90%8E%E5%B0%B1%E5%87%BA%E7%8E%B0%3FError+using+%3D%3D%3E+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)