Stop process and close plot with keyboard

Hi everyone,
This is part of my code.
plot(x, sensiv_graf2, 'r');
title ('Sensitivity average')
xlabel(Wavelength (nm)')
load value123.txt
xm= value123(:,1);
ym= value123(:,2);
I need that, after the plot, pressing one button on keyboard stop the process, close plot and then continue loading the texts. I've tried with 'stop', 'close' but it doesn't work at all.
How can I do it? thanks in advance!

4 comentarios

Walter Roberson
Walter Roberson el 10 de Ag. de 2012
Which "process" is to be stopped ?
Maybe pause() is what you want?
doc pause
Emmanuelle
Emmanuelle el 13 de Ag. de 2012
Walter, the plot. I don't know if it's possible. I want to close it and then, after pressing a keyboard, "continue" the code.
Matt, I've tried with "pause;" and it seems it works! (not efficiently!)
Azzi Abdelmalek
Azzi Abdelmalek el 13 de Ag. de 2012
do you mean you want to interrupt the plot?

Iniciar sesión para comentar.

Respuestas (1)

per isakson
per isakson el 13 de Ag. de 2012

0 votos

Maybe including the function, keyboard, in your code would help you achieve the required functionality.

Categorías

Más información sobre Desktop en Centro de ayuda y File Exchange.

Preguntada:

el 10 de Ag. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by