Matlab crashes without any log files while checking for issues in MATLAB 2023b Coder.

42 views (last 30 days)
I try to convert my matlab code to c++, but in the stage of "Cheking for issues", it closes without any error message, and I cannot find any log files named matlab_crash_dump, java.log, or hs_err in temp folder. Do you have any solutions for this issue? I tried to uncheck "Collect MATLAB line execution counts", but it didn't help.

Answers (1)

Hassaan
Hassaan on 15 Jan 2024
MATLAB's "Check for Issues" feature in the MATLAB Coder app can sometimes close unexpectedly due to various reasons, such as memory issues, incompatible code, or internal errors within MATLAB itself. Here are several steps you can take to troubleshoot and potentially resolve the issue:
Update MATLAB: Make sure you are running the latest version of MATLAB and have all the latest updates installed. Sometimes, bugs that cause crashes are fixed in later releases.
Simplify Your Code: If your MATLAB code is very complex, try simplifying it or breaking it down into smaller parts. Then, convert these parts one by one to see if a specific section of code is causing the problem.
Disable Parallel Computing (if applicable): If you are using parallel computing features, try disabling them. There might be an issue with the parallel execution when checking for issues.
Code Compatibility: Ensure that the MATLAB code is compatible with MATLAB Coder. Not all MATLAB functions and features are supported for code generation. You can check the MATLAB Coder documentation for more information.
Use MATLAB Coder Command Line: Instead of using the MATLAB Coder app, try using the command-line interface to convert the code. This might give you more detailed error messages.
coder -build myprj.prj
Replace myprj.prj with the name of your project file.
MATLAB Diagnostics: You can run MATLAB diagnostics to check for any configuration issues that might be causing problems.
matlab.internal.language.introspective.codeCompatibilityReport('myScript.m')
Replace myScript.m with the name of your script.
Check for Infinite Loops or Recursion: Make sure that there are no infinite loops or recursive calls without base cases in your code that could cause MATLAB to crash.
Contact MathWorks Support: If none of the above steps help, contact MathWorks Technical Support for assistance. They may request the problematic code to reproduce the issue on their end and provide a solution.
Check System Resources: Ensure your computer has enough RAM and CPU resources available. An overtaxed system might cause MATLAB to close unexpectedly.
Run MATLAB as Administrator (Windows): Try running MATLAB as an administrator to ensure it has the necessary permissions, which can sometimes resolve unexpected issues.
Remember to save your work frequently and back up your code to avoid losing progress if MATLAB crashes. If you manage to isolate a section of code that causes the crash, you can focus on rewriting or refactoring just that part to be compatible with MATLAB Coder.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
Feel free to contact me.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!