MATLAB: Using matlabFunction

matlabfunction

I wish to use matlabFunction to convert symbolic expressions into m-files. However, I can't even make the examples given on http://www.mathworks.com/help/toolbox/symbolic/matlabfunction.html work.
For example, if I type in the following command in Matlab (as copied from the above webpage):
syms x y z; r = x^2 + y^2 + z^2; f = matlabFunction(log(r)+r^(-1/2),'file','myfile');
then Matlab returns the following error message:
??? Error using ==> dataread Too many input arguments.
Error in ==> strread at 57 [varargout{1:nlhs}]=dataread('string',varargin{:},'bufsize',2*num );
Error in ==> ver at 69 p = strread(matlabpath,'%s','delimiter',[pathsep '\n']);
Error in ==> sym.matlabFunction>writeHeader at 386 symver = ver('symbolic');
Error in ==> sym.matlabFunction>writeMATLAB at 359 writeHeader(fid,fname,varnames,outnames);
Error in ==> sym.matlabFunction at 117 g = writeMATLAB(funs,file,varnames,outputs,body);
What's wrong???

Best Answer

Please try
which -all dataread
as it is possible that somehow you have your own function named dataread