MATLAB: Does the EVAL function returns an error for expressions containing new line characters, in MATLAB 7.0.1 (R14SP1)

characterevallineMATLABnewstring

I am using the following code:
foo = sprintf('\n\n\n5')
a = eval(foo)
and get the following error:
??? Error: Incomplete or misformed expression or statement.

Best Answer

Currently, EVAL does not have the functionality to assign outputs containing new line characters.
In order to workaround this issue, use EVAL with the following syntax:
foo = sprintf('\n\n\n5')
a = eval('foo')