Explanation

MATLAB is unable to analyze code within statements called by eval. This prevents MATLAB from performing any performance optimization and limits the guidance that the editor is able to provide. This makes code less efficient and difficult to debug.

Furthermore, concatenated character vectors within an eval statement are often difficult to read. This makes code less clear and causes issues with sharing and maintaining code.


Suggested Action

To allow MATLAB to perform performance optimization, use the variable directly and use eval for the right hand side of the assignment.

OldNew
eval( [ 'signal=', varname, ';' ] )     signal = eval(varname);