MATLAB: Anonymous function: creation

anonymoushandle

I am trying to create an anonymous function with f=@(x) sin(alpha*x). The error msg that I am getting is a 'bar' under @ and then '"identifier" expected, "(" found.' Even copy/pasting the command from MATLAB's website does not help. what went wrong here? I am using MATLAB R12 version.

Best Answer

Anonymous functions were introduced in MATLAB version 7.
It seems you are using version 6.