The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 9,850
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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.