can't use KummerU function

조회 수: 2 (최근 30일)
Daniel
Daniel 2013년 6월 5일
편집: Stephen23 2016년 1월 15일
Hi, When I try to use builtin kummerU function, it gives me "Undefined function 'kummerU' for input arguments of type 'double'." Needed package is installed, and I don't understand why can't the function use real number instead of complex with zero imaginary part.
Help!
Daniel

채택된 답변

Friedrich
Friedrich 2013년 6월 5일
편집: Stephen23 2016년 1월 15일
Hi,
kummerU is a Symbolic Math Toolbox function, so you can't simply call:
>> kummerU(1/3, 2.0, -50)
Undefined function 'kummerU' for input arguments of type 'double'.
You have to call:
>> evalin(symengine,'kummerU(1/3, 2.0, -50)')
ans =
0.13511493810668281560142994786047 - 0.23402593766229884316074691432347*i
Or use feval:
>> feval(symengine,'kummerU',1/3, '2.0', -50)
ans =
0.13511493810668281560142994786047 - 0.23402593766229884316074691432347*i
I used '2.0' in order to get a floating-point value otherwise you would get:
>> feval(symengine,'kummerU',1/3, 2.0, -50)
ans =
kummerU(1/3, 2, -50)
This is explained here:
  댓글 수: 4
Daniel
Daniel 2013년 7월 7일
I try to use hypergeom directly, but it returns the following error:
Error using mupadmex
Internal error with symbolic engine. Please quit and restart MATLAB.
Error in sym/hypergeom (line 1084)
hSym = mupadmex('symobj::map', args{1}.s, 'symobj::hypergeom',...
Error in hypergeom (line 35)
h = double(hypergeom(n,d,sym(z)));
Error in momentum (line 7)
x=hypergeom(p+nu+1,nu+1,alpha/2);
Error in Putprice (line 47)
Def=1-exp(-integral(bfunc,0,T))*(x^2/tau)^(1/(2*abs(beta)))*momentum(-1/(2*abs(beta)),delta,x^2/tau);
Error in LSQDiff (line 12)
Diff(:,i)= mktprice(:,i)-Putprice(S,K,T(i),x(1),x(2));
Error in C:\Program Files\MATLAB\MATLAB Production
Server\R2012b\toolbox\shared\optimlib\finDiffEvalAndChkErr.p>finDiffEvalAndChkErr
(line 26)
Error in C:\Program Files\MATLAB\MATLAB Production
Server\R2012b\toolbox\shared\optimlib\finitedifferences.p>finitedifferences (line
128)
Error in sfdnls (line 89)
[J,~,~,numEvals] = finitedifferences(x,fun,[],lb,ub,valx,[],[], ...
Error in snls (line 177)
[A,findiffevals] = sfdnls(xcurr,fvec,Jstr,group,[],funfcn{3},l,u,...
Error in lsqncommon (line 175)
[xC,FVAL,LAMBDA,JACOB,EXITFLAG,OUTPUT,msgData]=...
Error in lsqnonlin (line 232)
[xCurrent,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
Please help me solve this problem!
Friedrich
Friedrich 2013년 7월 9일
편집: Friedrich 2013년 7월 9일
Hi,
it seems like you compiled your MATLAB code into a generic CTF? Is this correct? If so, Symbolic Math TB functions can't be compiled.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Network Parameters에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by