How to display error

조회 수: 6 (최근 30일)
faran
faran 2018년 7월 6일
댓글: faran 2018년 7월 9일
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
OCDER
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
faran 2018년 7월 9일
So, I looked for the error and asked for help from mathwork and find out what was the problem. The problem was that I created a ocr.m file for my program and the compiling was not going well because of it. And I used the method you told me to find the error location and so far it is going well. Thank you so much

댓글을 달려면 로그인하십시오.

채택된 답변

OCDER
OCDER 2018년 7월 6일
  댓글 수: 1
faran
faran 2018년 7월 6일
I read it and I tried to open it through the method given but still it is only making sound and not showing any error.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by