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 个评论
David Sanchez
2013-5-21
Do you mean that even when your functions/scripts are located in the working directory Matlab does not find them?
Michael
2013-8-3
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)?
Friedrich
2013-8-5
Are you using cell mode (%% signs) in those m files? What happens if you type rehash before running any code?
Ole
2014-3-17
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?!
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!