Assignin variables in a stand-alone application
2 views (last 30 days)
Show older comments
I have a GUI with a button that uses the assignin() function to send variables to the 'base' for debug and analysis purposes when running the code in Matlab. What happens to these variables when the application is run as a stand-alone version? Should I disable the button when compiled as a stand-alone? Is there a test I can perform to determine if the button should be disabled or enabled?
3 Comments
Walter Roberson
on 4 Jun 2012
GUI functionality _is_ supported with MATLAB Compiler. GUI functionality is not, however, supported with MATLAB Coder.
Accepted Answer
Walter Roberson
on 4 Jun 2012
The variables still get assigned to the base workspace. The base workspace would get destroyed (along with all other workspaces) when the standalone application exited, but the variables can be used until that point.
If it does not make sense in your context to be able to save those variables in stand-alone mode, use isdeployed()
4 Comments
Walter Roberson
on 6 Jun 2012
"global variables" would be one way of looking at it, but the base workspace is distinct from the workspace of global variables.
More Answers (1)
Walter Roberson
on 22 Jun 2012
My previous answer might have been wrong about the base workspace existing in compiled applications. I am having difficulty finding documentation on this matter, but it is implied by Loren in http://blogs.mathworks.com/loren/2010/11/18/deploying-standalone-applications/ and in a small number of ambiguous cssm postings .
(Some day I'm going to be able to afford to get a MATLAB Compiler license and try these things myself... But it probably won't be soon.)
0 Comments
See Also
Categories
Find more on Variables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!