- 0: Indicates successful execution without errors.
- 1: General error or exception. This is a common exit code for many applications, indicating an unspecified failure.
- 249: Specific error, possibly related to file handling or path issues.
Description of Matlab Windows Application exit codes
30 views (last 30 days)
Show older comments
We created a simple test Windows application using Matlab Compiler. We are running it using command prompt with:
start /wait test.exe
and then getting the exit code with echo %errorlevel%. It works as expected.
By adding
quit(someNumber)
or
exit(someNumber)
to our code, echo returns someNumber, which is great.
But it seems that Matlab already has some 'reserved' exit codes for application crashes and we don't want to use the same exit code which Matlab itself already uses.
For example, by giving a path to a non existing file, application crashes and echo returns exit code 249.
Another example that we tried is trying to index an empty array. Application crashed and echo returned exit code 1.
Is there a list of Windows Matlab application exit codes with descriptions? Is there also a list of exit codes for when you are creating a Docker image for Linux OS?
0 Comments
Answers (1)
Shivam Lahoti
on 11 Nov 2024 at 18:13
Hello Dora,
I understand that you are working with MATLAB Compiler-generated applications and are concerned about the exit codes returned, especially when errors occur. These exit codes can indicate different types of issues, and you're looking for guidance on which codes might be reserved by MATLAB to avoid conflicts with your custom exit codes.
MATLAB Compiler-generated applications can indeed return specific exit codes, especially when they encounter errors. I am not aware if any formal document exists detailing MATLAB-specific exit codes. However, here are some of the known exit codes:
Regards,
Shivam
0 Comments
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!