Undefined function or method 'int' for input arguments of type 'double'.

2 次查看(过去 30 天)
Hi Everybody, I need your help please. When I run my following script:
x=-3:.1:3;
Go=1000;
Bc=5;
Pin=3*exp(-x.^2);
Ein(i)=int(Pin,x,-inf,inf);
for i=1:length(x);
z=x(i);
Eo(i)=int(Pin,x,-inf,z);
E(i)=Eo (i)/Ein(i);
G(i)=Go/(Go-(Go-1)*exp(-E(i)*0.1));
Pin=3*exp(-x(i)^2);
Pout(i)=Pin*G(i);
Phi(i)=-0.5*Bc*log(G(i))*pi/180;
Aout(i)=sqrt(Pout(i))*exp(i*Phi(i));
end
Aoutf=fftshift(fft(Aout,100000));
f=(-100000/2:(100000/2-1)).*1/(0.01*100000);
Poutf(i)=abs (Aoutf).^2;
plot(f,abs(Poutf),'-r*')
I get this error
Undefined function or method 'int' for input arguments of type
'double'.
Do you know how can I solve that please?

回答(1 个)

bym
bym 2011-12-11
Int is only defined for symbolic variables, for numeric values see
quadgk()

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by