最近在做高斯分布的振幅,半高宽NL=30,我只是验证一下我的程序能否算出我输入的高斯分布的振幅的半高宽,可是做出的程序算出来的半高宽是50,请教高手,我错在哪?

clc,clear,close all;

t=200;%时间

m=600;%时间份数

stept=t/m;

Y2=zeros(m,1);

Ip0=zeros(m,1);

NL=30;

for i=1:m%for t

t2=i*stept-t/2;

Ep0(i,1)=exp(-(t2*t2)/(NL*NL));

Y2(i,1)=i;

end%for i

plot(Y2(:,1),Ep0(:,1),'b-');

%计算

temp=max(Ep0(:,1));

Ztemp=-temp+Ep0(:,1);%Φ-Φm

center=Center(m,Ztemp);%center是编号

Ztemp1=Ep0(:,1)-(temp/2);%Φ-Φm/2

Ztemp2=abs(Ztemp1);

Ztemp3=submatrix(1,center,Ztemp2);

Ztemp4=min(Ztemp3);

Ztemp5=Ztemp3-Ztemp4;

T1=Center(center,Ztemp5);

Tleft=T1*stept;

Ztemp12=submatrix(center+1,m,Ztemp2);

Ztemp13=min(Ztemp12);

Ztemp15=Ztemp12-Ztemp13;

kkk=m-center;

T2=Center(kkk,Ztemp15);

Tright=(T2+center)*stept;

ma=Tright-Tleft

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐