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!

Answers (1)

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 Comments

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)
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
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 on 27 May 2015
Edited: CC on 27 May 2015
go back to where?

Sign in to comment.

Asked:

CC
on 26 May 2015

Edited:

CC
on 27 May 2015

Community Treasure Hunt

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

Start Hunting!