how can i integrate two functions?
7 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Walter Roberson
2018-2-9
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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!