I'm assuming that you're talking about an application that you compiled with inside MATLAB using mcc
. If that's the case there is a flag that you can use.
Here's the blurb from the MATLAB documentation.
-e Suppress MS-DOS Command Window
Suppress appearance of the MS-DOS command window when generating a standalone application. Use -e in place of the -m option. This option is available for Windows only. Use with -R option to generate error logging as such:
mcc -e -R -logfile -R 'filename' -v function_name
When I deploy applications I usually leave the window open so when others see some kind of error they can report it to me. If you want to hide it definitely use the -R as suggested above to generate an error log.