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
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.
Nikos P
Nikos P 2016년 3월 9일
편집: Nikos P 2016년 3월 9일
I am sorry for not being accurate...The truth is that I am very unexperienced with matlab, my problem is that i take an error, here is what I am trying to do:
fun=@(u,Q) u.*normcdf(u*Q,10,2); % this is what I try to integrate
quad(@(u) fun(u,Q),0,1)
Torsten
Torsten 2016년 3월 9일
Q is a scalar ?
Best wishes
Torsten.
Nikos P
Nikos P 2016년 3월 9일
편집: Nikos P 2016년 3월 9일
yes it is. i expect an output like 0.68444Q
"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에 대해 자세히 알아보기

태그

질문:

2016년 2월 29일

댓글:

2016년 3월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by