Effacer les filtres
Effacer les filtres

How to use a figure as 'if condition'?!

4 vues (au cours des 30 derniers jours)
sajjad hosseinifard
sajjad hosseinifard le 16 Juil 2018
Commenté : Fangjun Jiang le 16 Juil 2018
I's using an m file to plot some data, online. I want to make an 'if condition', when I close the figure that is plotting my data manually!! Shortly, How could I Initialize a loop by closing a specific figure?!(as I close the figure the loop being started)

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 16 Juil 2018
Would this work?
f1=figure;
...
status=close(f1);
You can then check the "status" using "if"
  2 commentaires
sajjad hosseinifard
sajjad hosseinifard le 16 Juil 2018
thank you because of your answer..yes it works..but I want to start the loop when I close the figure by clicking on the close button!!
Fangjun Jiang
Fangjun Jiang le 16 Juil 2018
a simple example
f1=figure;
set(f1,'DeleteFcn','for k=1:10; disp(k);end')
then close the figure manually

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Performance dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by