Sudden error occurs on executing Matlab program
조회 수: 8 (최근 30일)
이전 댓글 표시
Dear all,
I wrote some Matlab programs (several M files and functions) and saved them in a folder. I successfully ran these programs after finised writting. However, after I surfed Internet for a while and got back to ran them again, there were strang errors. For example, when I ran a file called Test.m I wrote, it complains
??? Undefined function or variable 'Test'
And it happens to all other programs (within the same folder) as well. If I copy them to a different drive or different folder, the error still occurs to some of the programs.
Would you please tell me why this happened and how to solve it?
Many thanks and I look forward to your reply.
Sincerely, Jinlong.
댓글 수: 0
채택된 답변
Jon
2011년 11월 3일
Make sure the folder they are in is in the MATLAB search path.
File > Set Path ...
댓글 수: 0
추가 답변 (2개)
David Young
2011년 11월 3일
Try changing the current MATLAB directory to the folder containing your M-files, or else adding that folder to your MATLAB path, using the addpath function or the path tool.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!