In an assignment A(I) = B, the number of elements in B and I must be the same.
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Environment and Settings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!