Difficulty in implementing equations & performing Function Integration (Error First input argument must be a function handle.)

I have been trying to implement the following equations but am having a problem with their implementation especially the third equation, which involves integration and takes the output value from the second equation.
Function f(Zb) is the Gaussian probability density function with mean 0 and SD 1, and function F(Zb) is the equivalent cumulative normal probability function.
I am sharing my code kindly specify what exactly am I doing wrong.
[num1, text1, raw1] = xlsread('C:\Users\Hawkins\Desktop\Excel Data\Daily Mean Temperature (North Las Vegas_July_2010).xlsx');
[num2, text2, raw2] = xlsread('C:\Users\Hawkins\Desktop\Excel Data\Monthly Mean Temperature (North Las Vegas_2010).xlsx');
prompt = 'What is the Base Temperature Value? ';
Tb = input(prompt)
Td1 = num1(:,[2]);
Tm1 = num2(:,[2]);
Td = Td1';
Tm = Tm1';
Sd = std(Td);
Zb = (Tb - Tm)/Sd;
%function fZb = NPDF (Zb) %This function is called later in the code
%e1 = 1/(sqrt(2*pi));
%e2 = -(Zb.^2)/2
%fZb = e1 * exp(e2)
%end
NPDF (Zb)
fun = NPDF (Zb)
xmin = -Inf
xmax = Zb
q = integral(fun,xmin,xmax)

 채택된 답변

Your integral equals
0.5*(1+erf(Zb/sqrt(2)))
No need to use "integral" in this simple case.
Best wishes
Torsten.

댓글 수: 4

Thank you Torsten, but can you please elaborate how my integral equals to the equation which you have stated. Cause I still couldn`t figure it out
I have also verified your response from here, but can you still please elaborate. http://www.mathworks.com/help/matlab/ref/erf.html
Read the paragraph
"Find cumulative distribution function of normal distribution"
under
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2015년 8월 14일

댓글:

2015년 8월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by