Effacer les filtres
Effacer les filtres

how can i integrate two functions?

3 vues (au cours des 30 derniers jours)
elham kreem
elham kreem le 9 Fév 2018
I have this function
y*(1/c)exp(-((y-m))^2/2st) dy
where y,m,t are vectors.
I want to integrate this function from a to b , I tried but the result is wrong , the function which I wrote it in matlab is :
fun = @(y) y* exp(-(y-m).^2/(2*s*t))
q= integral(fun , -3 , 2 )
can you help me?
thanks

Réponse acceptée

Walter Roberson
Walter Roberson le 9 Fév 2018
Are you certain you want to be using
-((y-m))^2 * pinv(2st)
which is what the / operator approximately means?
I suspect you want
fun = @(y) y* exp(-(y-m).^2 ./ (2.*s.*t))
q = integral(fun , -3 , 2, 'ArrayValued', true);
  1 commentaire
elham kreem
elham kreem le 9 Fév 2018
thank you very much , the result is ok

Connectez-vous pour commenter.

Plus de réponses (1)

elham kreem
elham kreem le 9 Fév 2018
To Birdman , thank you very much your answer is ok ,

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by