Effacer les filtres
Effacer les filtres

How do I get the figure number in MATLAB R2014b?

82 vues (au cours des 30 derniers jours)
MathWorks Support Team
MathWorks Support Team le 7 Oct 2014
Commenté : Steven Lord le 16 Août 2017
How do I get the figure number in MATLAB R2014b?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 7 Oct 2014
Starting in MATLAB R2014b, figure handles are object handles where previously they were integers.  Now to get the associated number for the figure, query the new Number property. For example, this code gets the number for the current figure.
n = get(gcf,'Number')
n =
1
The Number property is the value displayed in the figure title bar.
You can refer to a figure by its integer number. For example, figure(2) makes the figure with a Number property value of 2 the current figure.
  1 commentaire
Steven Lord
Steven Lord le 16 Août 2017
figure handles are object handles where previously they were integers. So in releases prior to R2014b, gcf returns a number not an object. The value 'on' that you receive is the value of the NumberTitle property of the figure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Produits


Version

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by