Can I Debug Compiled Code? Is there a reason that a program would run in the MATLAB environment but not as a standalone executable?
조회 수: 26 (최근 30일)
이전 댓글 표시
I have a gui and associated .m files that run properly from the MATLAB interface. When I compile them, however, the main function does not run properly. Based on output files, I know that it starts, but somewhere it dies before it finishes running. There are no error messages and nothing to indicate where it stops running. Again, it only has this problem in the compiled version.
Can anyone suggest a path I should explore? Is there a way to debug a compiled application? I haven't done much with the compiler so I could easily be missing something obvious.
Thanks
댓글 수: 0
채택된 답변
Image Analyst
2013년 11월 6일
Oh gosh yes, certainly. Happens all the time. Almost every time that you roll out an app for the very first time. One thing to check is the FAQ: http://matlab.wikia.com/wiki/FAQ#My_standalone_executable_won.27t_run_on_the_target_computer._What_can_I_try.3F
Let me know if none of those ideas work.
댓글 수: 2
Meade
2018년 10월 2일
Old post, but for posterity...
I use a function from the FEX called jprintf to generate a java window that I can throw console-ish statements to. It's a little hacky, but is robust and doesn't require anything extra at compile time (i.e. you can use the Matlab Compiler app with default settings).
추가 답변 (2개)
Thomas Richner
2018년 5월 15일
편집: Thomas Richner
2018년 5월 15일
Here's a link to a better answer: https://www.mathworks.com/matlabcentral/answers/93287-is-there-a-way-to-debug-a-matlab-compiler-4-0-r14-generated-executable
댓글 수: 1
Image Analyst
2018년 5월 15일
This "better answer" is just one of the things in the FAQ link I gave. It's #11 in the FAQ list.
Kent Schonert
2019년 6월 27일
It is often very helpful to save the workspace right before the offending error line executes when debugging. By reviewing the workspace contents of the resultant who.mat file, I can often figure out what the problem was.
if isdeployed
save who
end
% line # of error listed in MCR app command output
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!