Info
此问题已关闭。 请重新打开它进行编辑或回答。
Calling script within method fails
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a method which calls an external script. Example.
../../script.m:
ret = 1000;
The method looks as follows:
methods
function value = CalculateEntry(this)
run('../../script.m');
value = ret;
end
end
However, I get
??? Error using ==> CalculateEntry
Output argument "value" (and maybe others) not assigned during call to
...
When I debug the program I see that script.m is executed and "ret" is assigned. However, when "run" returns to "CalculateEntry", "ret" is suddenly NaN.
How to fix this?
1 个评论
Guillaume
2015-3-12
Why not convert the script into a function. It'll probably solve your problem and would be cleaner anyway as it's then clear what the inputs and outputs are
回答(1 个)
此问题已关闭。
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!