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 个评论

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.
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)
Q is a scalar ?
Best wishes
Torsten.
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 中查找有关 Numerical Integration and Differentiation 的更多信息

标签

提问:

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