hypergeom function always retruns symbolic results

I recently found a problem when I use MATLAB(2013a). I have used the function "hypergeom" for years and it works well until today I found that it always returns symbolic results, even if all the parameters are numbers. See the image below.
I don't know why it suddenly turns to this. I guess maybe it caused by Python, since I am learning Python recently and I use scipy.special.hyp2f1 in Python.
Anyone could help me to make the hypergeom functions back to normal? I mean when the inputs are numbers, then it returns floating-point. Thanks!

답변 (1개)

Walter Roberson
Walter Roberson 2015년 5월 26일

0 개 추천

apply double() to the symbolic number.
hypergeom() is a Symbolic Toolbox function and always has been. The Symbolic Toolbox is defined to return symbolic numbers. There are contexts in which the symbolic numbers would be converted on your behalf when you used them, so it might not have mattered before to you.

댓글 수: 6

CC
CC 2015년 5월 27일
Hi Walter,
Thank you for your answer. It did work if I add double() outside the hypergeom function. But I think the issue is still there. After posting the question, I found that I do not have the symbolic toolbox in the Matlab (by typing ver , there is no symbolic toolbox). Also, It shows "Undefined function or variable 'symengine'" after I type symengine . Do you have ideas on how to solve this?
Thanks!
What does
which -all hypergeom
return? Perhaps you had a numeric hypergeometic function from another source, and perhaps it is now being shadowed by something else (such as python)
CC
CC 2015년 5월 27일
Hi Walter,
It returns:
>> which -all hypergeom
D:\Program Files\MATLAB\R2013a\toolbox\maple\hypergeom.m
D:\Program Files\MATLAB\R2013a\toolbox\maple\@sym\hypergeom.m % sym method
CC
CC 2015년 5월 27일
I actually can find another "hypergeom.m" file in the folder:
D:\Program Files\MATLAB\R2013a\toolbox\symbolic\symbolic
But it seems that Matlab does not recognize it.
It sounds as if you have installed the Maple Connector. You could uninstall that but you will not go back to
CC
CC 2015년 5월 27일
편집: CC 2015년 5월 27일
go back to where?

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

카테고리

도움말 센터File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

질문:

CC
2015년 5월 26일

편집:

CC
2015년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by