How to display error
이전 댓글 표시
I created a Gui and when I am running from the .exe file it crashes and just make a sound which is showing that the program stopped. When I am running it through matlab it works perfect and there is no error. How can I add something to the program to show what is the error and why the program crashes? I need to display the error while i am using the .exe file.
댓글 수: 9
Geoff Hayes
2018년 7월 6일
Sara - is the crash reproducible? what are you doing when the app crashes?
faran
2018년 7월 6일
OCDER
2018년 7월 6일
Could it be related to this error you got before? https://www.mathworks.com/matlabcentral/answers/409147-having-problem-in-compiling
Perhaps OCRBuildable.m was not packaged in the compiled application, thus causing it to crash?
Geoff Hayes
2018년 7월 6일
Sara - but what are you doing - in the app/GUI - when it crashes? Does it always crash when you repeat those steps?
faran
2018년 7월 6일
OCDER
2018년 7월 6일
" I tried other part of the Gui and they are working, only on the OCR section I guess it is crashing!"
So just to clarify, your EXE file DOES run, but then it just crashes and exits when you try OCR? And you were able to compile WITHOUT any error, as in OCRBuildable.m issue you had is resolved?
It'll be hard to figure out the issue unless we see the full GUI and .m files for it.
faran
2018년 7월 6일
OCDER
2018년 7월 6일
Do you have the license for the computer visions toolbox? The compiler will check to make sure you have the toolbox license activated before it compile the application. Also, certain Computer Vision Toolbox components cannot be compiled - see if you have any of these in your code:
If you do, you'll have to disable it using statements like:
if ~isdeployed
.... your OCR code
else
warning('this function is not available for deployed version').
return
end
There's isn't a OCRBuildable.m document, so not sure which functions are using that. You'll have to hunt that function down... or try adding some msgbox throughout your OCR code to see which msgbox appears before crashing. It'll narrow your search.
a = 1;
msgbox('line 1 passed')
b = 2;
msgbox('line 3 passed')
c = myOCR(a, b)
msgbox('line 5 passed'); %In exe, this didn't show up, so you know error occurred before this.
faran
2018년 7월 9일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!