Azzera filtri
Azzera filtri

why does the fist code give me warning while the second code works well?

1 visualizzazione (ultimi 30 giorni)
why does the fist code tells me minimum step size reached, while the second one give me no warnings? Thank you very much for your help.
this is the first one:
ff=@(x) 1./x ; b=quad(ff,0,1)
Warning: Minimum step size reached; singularity possible.
> In quad at 103
b =
45.5496
here is the second one:
ff=@(x) sqrt(log(1./x)) ; b=quad(ff,0,1)
b =
0.88621

Risposta accettata

Walter Roberson
Walter Roberson il 8 Ott 2011
The second one has a finite integral over that region, sqrt(pi)/2

Più risposte (0)

Categorie

Scopri di più su Performance Profiling in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by