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!