Undefined Function or Variable - for no reason

For some reason Matlab2013a won't accept any declaration other than predeclared matlab functions. Any custom made function or script I write returns 'Undefined function or variable 'myscriptname'.'
I have the path defined correctly and my function is defined properly. I am simply trying to call functions and scripts located in my working directory.
When it try edit 'myscriptname' - matlab locates and opens the function/scripts for editing, but as soon as I try and run it, matlab gets confused and it wont run.
I have been using matlab for years, never encountered this problem. This has only just occured on a new version I have only just installed today (2013a).
What is weird is that, I can copy those files in a different folder, and sometimes, just sometimes, they will work. For a little while before becoming un-callable again.
Does anyone have any clue what is going on?

5 Kommentare

David Sanchez
David Sanchez am 21 Mai 2013
Do you mean that even when your functions/scripts are located in the working directory Matlab does not find them?
Michael
Michael am 3 Aug. 2013
Chris I just moved to matlab 2013a and I am having the same issue. How did you sort it out? (I hope you did by now!)
dpb
dpb am 3 Aug. 2013
Bearbeitet: dpb am 3 Aug. 2013
'Course it's a Saturday so won't be anybody home but this sounds like time for support/bug report to official TMW support...
Just out of curiosity what does
which
think of the function(s)?
Friedrich
Friedrich am 5 Aug. 2013
Are you using cell mode (%% signs) in those m files? What happens if you type rehash before running any code?
Ole
Ole am 17 Mär. 2014
I want to double this. Matlab2013a finds scripts in the current working directory, but other search paths do not work, including the native paths such as e.g. '.../toolbox/matlab/grapics'. 'which' returns "'scriptName' not found" for all extra scripts I put there. It does not depend on cell mode tags (%%) and rehash does not help.
Now interestingly it does not even have an effect if I remove, say, figure.m. The command 'figure' still works, even after calling rehash. At what point does matlab scan all those files in the native search paths?!

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 21 Mai 2013

Kommentiert:

Ole
am 17 Mär. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by