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!