Info
この質問は閉じられています。 編集または回答するには再度開いてください。
"Clear" function is not evaluated properly once program converted to exe
1 回表示 (過去 30 日間)
古いコメントを表示
I have created an executable from my GUI program. However, I have used a line to clear from matlab memory old files:
clear function
While working in Matlab environment, everything is ok. However, once converted to executable the program does not properly evaluates that line. I can see this, because executable produces the same results for the loop, meaning that program keeps executing "function", while in Matlab environment that function is overwritten by a new function.
Does anybody knows how this issue could be solved?
1 件のコメント
Jan
2013 年 3 月 14 日
It is not clear, when "function" means your function name, and when it means the term function. Did you use clear YourFuncName or is it a typo and you want clear functions with a trailing 's'?
回答 (1 件)
Jan
2013 年 3 月 14 日
You want a deployed function to write an M-function dynamically and evaluate it? What is exactly the difference between deployed and not-deployed functions then? Does this mean that it is trivial to emulate a locally installed Matlab just by a deployed tool, which write M-files dynamically and executes them? This would be rather strange and smell like a massive copyright problem, when running deployed code is allowed without owning a Matlab version. But perhaps I misunderstood something.
The most efficient way to solve this is to avoid the dynamic creation of M-files strictly. This would be a good idea for different reasons, e.g. to reduce the complexity, to allow for an easier debugging and to increase the efficiency.
2 件のコメント
Jan
2013 年 3 月 18 日
The deployed code should be able to create the M-file. I'd expect, that this M-file cannot be interpreted, but the deployed code runs only the M-files, which have been existing during the procedure of deployment - but this assumption could be wrong, although anything else would be rather strange.
How do you see, that the M-files are not created? Did you specify a folder where to save them?
Again I strongly recommend not to create M-code dynamically, because such meta-programming is a bad programming pattern. As you see, it causes more troubles than it solves.
この質問は閉じられています。
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!