Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: eval - Error: Unexpected MATLAB operator
Replies: 1   Last Post: Dec 10, 2012 1:04 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,137
Registered: 6/7/07
Re: eval - Error: Unexpected MATLAB operator
Posted: Dec 10, 2012 1:04 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 12/10/2012 11:56 AM, Joana wrote:
> I'm analyzing an old code where they recommend to use matlab 5!!
>
> this is what is written:
>
> [cfile,dir] = uigetfile(zid)
> eval(['cd' dir]);
>
> It gives me "Error: Unexpected MATLAB operator" could it be because
> something has changed in this current version?


No, it's because you didn't include a blank to separate the directory
from the command --

eval(['cd ' dir]);

But, you don't need the eval; just use the builtin ML cd command/function

doc cd

--





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.