Borrar filtros
Borrar filtros

Problem with 'pause' when I generate an .exe

3 visualizaciones (últimos 30 días)
Set Rubio
Set Rubio el 26 de Ag. de 2015
Comentada: Filippo Piatti el 20 de Nov. de 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 comentario
Filippo Piatti
Filippo Piatti el 20 de Nov. de 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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB Compiler SDK en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by