Error in quad function-maximum function count exceeded

5 Ansichten (letzte 30 Tage)
Elsa Sw
Elsa Sw am 23 Dez. 2011
Hi all, i need help using the quad function.
function y = myfun(x) y = exp(b*z)*exp((6*a.^2-i*k*w.^2*z)/(z.^2+a.^2))./(a+i*z);
>> F = @(z) exp(b*z)*exp((6*a.^2-i*k*w.^2*z)/(z.^2+a.^2))./(a+i*z); Q = quad(F,0,2); Warning: Maximum function count exceeded; singularity likely. > In quad at 106
Anyone know what the warning means?? Thank you..

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 23 Dez. 2011
try use quadgk
for example:
b=1;a=1;k=1;w=1;
F = @(z) exp(b*z).*exp((6*a^2-1i*k*w^2*z)./(z.^2+a^2))./(a+1i*z)
quadgk(F,0,2)
quad(F,0,2)
  2 Kommentare
Elsa Sw
Elsa Sw am 27 Dez. 2011
It works.Thanks alot Andrei
Elsa Sw
Elsa Sw am 27 Dez. 2011
It works.Thanks alot Andrei

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by