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

2 visualizaciones (últimos 30 días)
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?

Respuestas (1)

Walter Roberson
Walter Roberson el 19 de Mayo de 2016
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 comentarios
Matt Butts
Matt Butts el 19 de Mayo de 2016
Thanks Walter. There is no GUI involved though. I will check the target settings and see if that helps.

Iniciar sesión para comentar.

Categorías

Más información sobre Standalone Applications en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by