normcdf() not working

조회 수: 9 (최근 30일)
dxander
dxander 2015년 9월 4일
댓글: dxander 2015년 9월 5일
Initially I was writing a program to evaluate the Black-Scholes formula from given values but when I attempted to include normcdf function I got an error. Not sure what is causing it.
>
> normcdf(.5)
Undefined function 'normcdf' for input arguments of type 'double'.
>> b = normcdf(.7)
Undefined function 'normcdf' for input arguments of type 'double'.
  댓글 수: 4
dxander
dxander 2015년 9월 5일
편집: dxander 2015년 9월 5일
C:\Program Files\MATLAB\R2014a\toolbox\stats\stats\normcdf.m % Has no license available Thanks for the advice I will download it. Is there a program in base Matlab that does the same?
dxander
dxander 2015년 9월 5일
It works with the new download. 2015b

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

답변 (1개)

Star Strider
Star Strider 2015년 9월 5일
Either you need to get a license for it (contact the person responsible for such things in your orgainsation), or if you just want a quick fix (no confidence bounds), this works:
nrmcdf = @(x,m,s) integral(@(t)exp(-(t-m).^2./(2*s.^2)), -Inf, x )./(s*sqrt(2*pi)); % Variable=‘x’, Mean=‘m’, StdDev=‘s’
Q1 = nrmcdf(-1, 0, 1);
Q2 = nrmcdf(+1, 0, 1);
Qd = Q2-Q1;
The ‘Q’ values are for demonstration only, and show the part of the curve between [+1 -1] standard deviations, with mean=0 and std=1.

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by