Integral of a product between a function and a Cumulative Normal Distribution
이전 댓글 표시
Hi.
I need to compute an integral of a function that consist in the product between a Cumulative distribution of a Normal, and another term.
I tried using the command int, but in that case I was not able to execute the normcdf command.
Matlab said: CNaux2=normcdf(aux5) Error using NaN Trailing string input must be 'single' or 'double'.
Instead, i tried using the quad command. In that case, the normcdf could be defined as a function handle, but then i coul not excute the quad command. In this case matlab said
Error using * Inner matrix dimensions must agree.
And i don´t understand why, because i don´t have any matrix here, i have only a product of functions of one variable.
Could you please help me?
Thanks! Javier
채택된 답변
추가 답변 (1개)
Youssef Khmou
2013년 3월 27일
편집: Youssef Khmou
2013년 3월 27일
hi,
I am no sure about the error you get, but try this version :
m=0;
s=1;
x=0:0.1:10;
C=normcdf(x,m,s);
PHI=2*exp(j*2*pi*x); % Consider it as wave function
N=abs(PHI).^2; % consider it as the probability of existence .
b=exp(-(x-2).^2);; % the thrid function as you consider
II=C.*b.*N;
figure, plot(x,II);
F=trapz(x,II);
So the integral is evaluated using the function "trapz" along the X axis ,
I hope this helps
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!