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!