Undefined function or variable 'matlabFunction'.

Dear all,
I am trying to use 'matlabFunction' feature to convert a symbolic expression into the function. I used an example, given in a help file:
syms x y
r = sqrt(x^2 + y^2);
ht = matlabFunction(sin(r)/r, cos(r)/r)
However, what I always get, is a error message: Undefined function or variable 'matlabFunction'.
I am sure, Symbolic Math Toolbox is installed, cause in the uninstall menu all of the toolboxed as checked as available.
Any suggestions how to make it working?
Thank you in advance!

Respuestas (2)

Star Strider
Star Strider el 3 de Abr. de 2017

0 votos

If you have the Symbolic Math Toolbox from R2008a or later, you will have matlabFunction.

5 comentarios

MATLAB 2016a. I have even a corresponding file in the folder: \MATLAB\R2016a\toolbox\symbolic\symbolic
But still result is the same.
But if I check available toolboxes with a command VER, it is not listed. Can it be a problem?
See if running these lines from your Command Window (or a script) solves the problem:
restoredefaultpath
rehash toolboxcache
Otherwise, you may need to Contact Tech Support.
Symbolic Math Toolbox has reappeared after the command, but now I am getting another error:
An error occurred while trying to
determine whether "sym" is a function
name.
Error in Untitled (line 4)
syms x y
Caused by:
Cannot redefine class 'sym' without
a call to 'clear classes'.
end
Star Strider
Star Strider el 4 de Abr. de 2017
See if rebooting MATLAB solves that problem.
Re-installation of MATLAB did solve the problem.

Iniciar sesión para comentar.

Walter Roberson
Walter Roberson el 4 de Abr. de 2017

0 votos

A couple of people have reported this in the past for R2016a. The solution appears to be to reinstall the Symbolic Toolbox

Etiquetas

Preguntada:

el 3 de Abr. de 2017

Comentada:

el 4 de Abr. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by