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 Comments

Do you mean that even when your functions/scripts are located in the working directory Matlab does not find them?
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!)
'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)?
Are you using cell mode (%% signs) in those m files? What happens if you type rehash before running any code?
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?!

Sign in to comment.

Answers (0)

Categories

Products

Asked:

on 21 May 2013

Commented:

Ole
on 17 Mar 2014

Community Treasure Hunt

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

Start Hunting!