필터 지우기
필터 지우기

Problem with 'pause' when I generate an .exe

조회 수: 3 (최근 30일)
Set Rubio
Set Rubio 2015년 8월 26일
댓글: Filippo Piatti 2015년 11월 20일
I need take a data of a cursor in my program.
I do that in this way:
datacursormode on;
pause;
datacursormode off;
dcm_obj = datacursormode(superficie);
C=dcm_obj.getCursorInfo.Position;
I put the command "pause" because the next lines needed to wait that the user select the point.
It run perfectly when I execute this program in matlab.
But when I generate the .exe and I run the program, the program never past of this point.
After that I use an "imread"
im=imread('imagen.png');
I put the pictur in the .exe folder so I think this is not the problem, but I mention it just in case it was important.
Sorry for my English. Thanks in advance
  댓글 수: 1
Filippo Piatti
Filippo Piatti 2015년 11월 20일
Dear Rubio, I recently came across extacly the same problem. As far as I understood, Matlab pause() command have some stability and accuracy issues (many posts suggest using java threads instead), and surely cannot be compiled in standalone apps. So, what I did was to solve the problem not using pause but with a simpler and more stable msgbox, as below:
uiwait(msgbox('Press ok'));
Overall, the user must give a keyboard input in both the cases (pause and uiwait), but the second one...works!
I hope this solution may be suitable also for your case. If you find out any smarter one, please let me know!
Best Filippo

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

답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by