| 查看: 288 | 回复: 1 | |||
| 当前主题已经存档。 | |||
[交流]
【求助】load函数出错
|
|||
|
我把一个程序中经常调用的一些数据存在mat文件中,如果哪个函数要用就load这个文件,一般没问题,但这次出现了如下的错误提示,没看明白 ??? Either eval, evalin, assignin, an assignment in a script, load, or an assignment at the debugger prompt has attempted to dynamically add the variable "status" to the workspace of one of: o an anonymous function, o a nested function, or o a function that has a nested function. If you are in the debugger and need a variable, say X, for temporary use while debugging, make it a global: K>> global X; X = ... One way to avoid this error in the other cases is to pre-declare the variable in the desired function. Specific suggestions to eliminate the error: o eval, evalin, assignin --- for many reasons, it is best to avoid using these altogether. o assignment in a script --- a script can be turned into a function, with argument- and result-passing often clarifying the code. o load --- use the form of load that returns a struct result. Dynamic addition of variables to workspaces associated with nested functions is not allowed because the scoping rules for nested functions rely on the presence or absence of variables in the text of the code. Permitting the addition of variables at run-time would make the scoping rules more difficult to explain and programs harder to understand. Similarly, dynamic addition of variables to the workspace of an anonymous function is not allowed. [ Last edited by sunxiao on 2009-3-21 at 09:53 ] |
» 猜你喜欢
40+中年人失业后,还能找到好工作吗?
已经有11人回复
用NBS溴化时溶剂除了CCl4外还有什么
已经有6人回复
申请科研项目纯靠实力能成功吗?
已经有11人回复
极限拉扯,如何抉择
已经有15人回复
二审4个多月了还是Awaiting Reviewer Scores
已经有4人回复
OpenAI又攻克数学难题了,离AI做有机合成还有多远?
已经有13人回复
课题组会帮你通过考核么?
已经有7人回复
售一区SCI文章T0P,我:8O.551.O54,科目全,可十急
已经有9人回复
售SCI一区文章,我:8O5.5.1.O5.4,科目全,可伽急
已经有10人回复
售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急
已经有8人回复
2楼2009-03-20 18:30:44










回复此楼
200