In an assignment A(I) = B, the number of elements in B and I must be the same.
이전 댓글 표시
Hi every body,
When I run this code:
t=-3:.1:3;
Go=1000;
Bc=5;
Pin=@(t)3*exp(-t.^2);
Ein = quadgk(Pin,-inf,inf);
for m=1:length(t);
z=t(m);
E1=quadgk (Pin,-inf,z)/Ein;
G(m)=Go/(Go-(Go-1)*exp(-E1*0.1));
Pout(m)=Pin(z)*G.*1;
Phi(m)=-0.5*Bc*log(G.*1);
Aout(m)=sqrt(Pout)*exp(i*Phi);
end
Aoutf=fftshift(fft(Aout,100000));
f = -(-100000/2:(100000/2-1)).*1/(0.01*100000);
Poutf = abs (Aoutf).^2;
plot(f,Poutf,'--')
xlim([-15 5])
I face this error:
In an assignment A(I) = B, the number of elements in B and I must be the same.
Please help me, and thanks all in advance
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!