How can I find the integral of normpdf(X,1,0) from -inf to inf?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How can I find the integral of normpdf(x,1,0) from -inf to inf?
The followings did not work:
F = @(x)normpdf(x, 0, 1);
Q = quad(F,-Inf,Inf);
---------
syms x;
int('normpdf(x,0,1)',-inf,inf)
0 Commenti
Risposte (2)
Wayne King
il 4 Giu 2013
F = @(x)normpdf(x, 0, 1);
Q = integral(F,-Inf,Inf);
5 Commenti
Colin
il 17 Mar 2019
F = @(x)normpdf(x, 0, 1);
Q = integral(F,-Inf,Inf);
This works nicely, but this:
F = @(x)normpdf(x, 350, 20);
Q = integral(F,-Inf,Inf);
gives
Q = 3.4540e-29
Seems likes it's not very robust.
Wayne King
il 4 Giu 2013
Modificato: Wayne King
il 4 Giu 2013
integral() was introduced in R2012a. It is used to numerically evaluate an integral, not symbolically and integral() can be unused on unbounded sets like (-Inf,Inf)
Again, in your case you can use quad() far short of (-Inf,Inf) and get 1.
5 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!