Can I force a standlone application to wait until execution is complete?

3 次查看(过去 30 天)
MATLAB: 2013b, win64
I have compile a very simple tool using MATLAB deploytool and it is being compiled as a standalone executable. The tool is then run from the command line.
My issue is that the command exits immediately and does not wait for the function to finish processing (the tool is creating a file that is needed further down the line).
I know that I can do things on the command line to make execution wait, but my delivery stops at the tool and I would like my delivery to be robust to this issue.
Is there something I can do in the main m-function or as a MATLAB compiler option that will force the resulting executable to wait until all processing is finished?

回答(1 个)

Walter Roberson
Walter Roberson 2016-5-19
Some possibilities include:
  • The executable being built includes functions that cannot be deployed, and the executable exits as soon as it tries to use those functions. For example nothing in the symbolic toolbox an be deployed.
  • The executable uses timers or callbacks to do its work, such as waiting for I/O using callbacks. Executables return as soon as the most immediate function call finishes, which destroys any timer or I/O objects. You need to do something like uiwait() or waitfor() something that indicates that your work is finished. For example there is a timer StopFcn callback that can be used to uiresume()
  • The executable is a GUI that relies on callbacks to do its work. This has the exact same difficulty as above. If you built the GUI using GUIDE, look for the uiwait() that is commented out and remove the comment marker, enabling the uiwait().
  4 个评论
Matt Butts
Matt Butts 2016-5-19
Thanks Walter. There is no GUI involved though. I will check the target settings and see if that helps.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Standalone Applications 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by