matlab 怎样计算下面的公式?各位帮帮忙!我就这点财富,全给大家了!x=(0:pi/100:pi/2); h=0.01; l=(2:0.2:12); k=2.*pi./l; syms n x; y1=(k.*cos(90+x)).^2.*(n-1); y2=gamma(n+1); y3=y1./y2; y=symsum(y3,n,1,5);z=(abs(1+cos(90+x))).^2.*(k

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 03:59:15
matlab怎样计算下面的公式?各位帮帮忙!我就这点财富,全给大家了!x=(0:pi/100:pi/2);h=0.01;l=(2:0.2:12);k=2.*pi./l;symsnx;y1=(k.*co

matlab 怎样计算下面的公式?各位帮帮忙!我就这点财富,全给大家了!x=(0:pi/100:pi/2); h=0.01; l=(2:0.2:12); k=2.*pi./l; syms n x; y1=(k.*cos(90+x)).^2.*(n-1); y2=gamma(n+1); y3=y1./y2; y=symsum(y3,n,1,5);z=(abs(1+cos(90+x))).^2.*(k
matlab 怎样计算下面的公式?各位帮帮忙!我就这点财富,全给大家了!
x=(0:pi/100:pi/2);
h=0.01;
l=(2:0.2:12);
k=2.*pi./l;
syms n x;
y1=(k.*cos(90+x)).^2.*(n-1);
y2=gamma(n+1);
y3=y1./y2;
y=symsum(y3,n,1,5);
z=(abs(1+cos(90+x))).^2.*(k.^3).*(exp(-k.^2.*h.^2.*(1+cos(x)).^2)).*y;
M=1-int(z,x,0,pi./2);
l=(2:0.2:12);
plot(l,subs(M))
运行时出现:
Warning: Explicit integral could not be found.
> In sym.int at 58
? Error using ==> plot
Conversion to double from sym is not possible.

matlab 怎样计算下面的公式?各位帮帮忙!我就这点财富,全给大家了!x=(0:pi/100:pi/2); h=0.01; l=(2:0.2:12); k=2.*pi./l; syms n x; y1=(k.*cos(90+x)).^2.*(n-1); y2=gamma(n+1); y3=y1./y2; y=symsum(y3,n,1,5);z=(abs(1+cos(90+x))).^2.*(k
clear all;
clc;
warning off;%关闭警告提示
x=0:pi/100:pi/2;
h=0.01;
l=2:0.2:12;
k=2*pi./l;
syms n x;
y1=(k.*cos(90+x)).^2.*(n-1);
y2=gamma(n+1);
y3=y1./y2;
y=symsum(y3,n,1,5);
z=(abs(1+cos(90+x))).^2.*(k.^3).*(exp(-k.^2.*h.^2.*(1+cos(x)).^2)).*y;
M=1-int(z,x,0,pi./2);
M=double(M);%将符号变量M转换为数值
plot(l,subs(M));