Integrating function that contains distribution
이전 댓글 표시
Hi! I need to integrate a function fun=u*F(Qu)*g(u) from 0 to 1. Where F is CDF of the normal distribution and g is the PDF of another one.
댓글 수: 5
John D'Errico
2016년 2월 29일
편집: John D'Errico
2016년 2월 29일
And so what is your question? You have stated your need. Are you asking us to do your work?
help integral
help int
Choose one, depending on whether you want to do a numerical or symbolic integration.
Yes, my comment may seem non-useful. But the fact is, we don't know who you are. We have no idea as to your skill/knowledge level about MATLAB, about mathematics in general. Do you not know what integration is? do you not know what the corresponding PDFs might be? Do you not know how to use the tools in MATLAB? Do you know what MATLAB is and how to use it period? The fact is, all of the above issues are ones that I have seen in people who might post something up here. How do we know what your problem is in this matter?
When you have an actual question, then ask it.
Torsten
2016년 3월 9일
Q is a scalar ?
Best wishes
Torsten.
Torsten
2016년 3월 10일
"quad" does not accept symbolic variables in the function definition. Thus Q has to be an explicit real number.
Try whether
Q=1;
fun=@(u,Q) u.*normcdf(u*Q,10,2); % this is what I try to integrate
quad(@(u) fun(u,Q),0,1)
works.
Best wishes
Torsten.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!