错误提示就是这个,我也找到解决方案“
问题描述:the most common problem with using script files is that MATLAB cannot locate the script file you wish to execute. This errorcan be very frustrating to inexperienced MATLAB users because MATLAB gives the error message: ??? Undefined function or variable ...
解决方案:
and it is not immediately clear why the function is undefined when its m-file is clearly visible to the user.
The solution to this is to make sure that MATLAB's internal path variable is set to the direction containing the script.
我是在根目录A直接建立函数a,其中a函数里面有调用函数b是在A的子目录C,函数b又调用赋值脚本文件c在A的子目录B里面。
然后执行过程中就发现就发现赋值部分没有被执行!
算不算他说的‘ that MATLAB's internal path variable is set to the direction containing the script’.按说我这些都是在根目录A建立的文件呀,
更加有趣的是我如果先单步运行一下,所有的值都赋值成功,下一次就可以正常运行,但是如果不执行单步,就会出现以上提示~好奇怪