Error: Unexpected MATLAB expression.

I am unable to execute a file.I don't know what to do.It is very much important for me to execute the file.Whenever i try to execute it,command window displays "Error: Unexpected MATLAB expression." & a dialog box in the editor shows to run this file, you can either change the matlab current directory or add its directory to the MATLAB path. there are 4 options for chage directory , add to path, cancel, help.
Please help me how to execute this file.I am a newbie to MATLAB

 Accepted Answer

Image Analyst
Image Analyst on 13 Jul 2012
Edited: Image Analyst on 13 Jul 2012
When it asks you, tell it to change directory. The problem is that the current directory (seen in the drop down list at the top middle of your screen) is not the folder where your m-file lives. It needs to be, so this question you are seeing is normal. Tell it to change the folder and you should be okay.

1 Comment

You are certainly right with own MATLAB files. I was under the impression the user is unable execute built-in commands. Let's see.

Sign in to comment.

More Answers (1)

Andreas Goser
Andreas Goser on 13 Jul 2012
Edited: Andreas Goser on 13 Jul 2012
If you can execture really simple stuff like
plot(1:10)
then your installation is probably corrupt and needs a re-install. If this persistens, please call installation support.
The community may be able to help you, but in my experience, re-install is the quickest way.
Whatever is wrong has to do with paths as MATLAB can't find the commands. But it looks that you would not even be able to execte commands like PATH, ADDPATH etc...

Categories

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!