Filter löschen
Filter löschen

Problem with 'pause' when I generate an .exe

3 Ansichten (letzte 30 Tage)
Set Rubio
Set Rubio am 26 Aug. 2015
Kommentiert: Filippo Piatti am 20 Nov. 2015
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 Kommentar
Filippo Piatti
Filippo Piatti am 20 Nov. 2015
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

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB Compiler SDK finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by