| someone 2008-01-31, 8:28 pm |
| ms <silvertonm@gmail.com> wrote in message <fd580ab7-c839-
444f-a140-d76ecee96868@d4g2000prg.googlegroups.com>...
> Is there any particular reason why you would rather use
eval(['cd ' 'c:
> \folder']) versus something like cd('c:\folder')? I have
noticed both
> ways and don't know the difference.
The general rule of thumb is not to use EVAL unless there
is no other way.
Here is an excerpt from the MATLAB help on "Evaluating
Expressions"
While the eval function can provide a convenient solution
to certain programming challenges, it is best to limit
its use. The main reason is that code that uses eval is
often difficult to read and hard to debug. A second reason
is that eval statements cannot always be translated into C
or C++ code by the MATLAB Compiler.
|