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
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 件)

カテゴリ

タグ

質問済み:

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