openfig gives figure with no handle!

2 visualizaciones (últimos 30 días)
Bill betz
Bill betz el 20 de Abr. de 2016
Comentada: Walter Roberson el 20 de Abr. de 2016
The 2014B "ugrade" is a disaster! Openfig opens figure, but it has no handle...
IN 2015:
>> h=openfig('pv','new')
h =
Figure (fig) with properties:
Number: [] *<-- NOTE NO HANDLE!!*
Name: '_1'
Color: [0.9412 0.9412 0.9412]
Position: [58 39 507 459]
Units: 'pixels'
Show all properties
***************************
IN 2013B:
>> h=openfig('pv','new')
h =
173.0011
HELP! How can I use openfig and keep track of multiple open figures?
Thanks,
Bill
  2 comentarios
Charles Teasley
Charles Teasley el 20 de Abr. de 2016
Editada: Charles Teasley el 20 de Abr. de 2016
Hello Bill,
I am confused a little. What is 'pv'? The "openfigure()" class needs an existing figure name (i.e. "Figure.fig"). Once I execute your code with an existing figure name I get handles. Therefore, I need more info. I'm using 2015b.
Charles
Walter Roberson
Walter Roberson el 20 de Abr. de 2016
openfig() loads .fig file and returns its handle, so pv.fig was being loaded.

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 20 de Abr. de 2016
HG2, R2014b and later, no longer use numeric handles. The h you are getting returned is the handle. As long as you use the content, you will be fine.
If you really need to, then use for the next few releases you can use double(h) to get a numeric value. You would generally need to use handle() to get back to the handle before it could be further used, but you can use it to assure yourself that you are referring to different figures.
You can also use
set(h, 'IntegerHandle', 'on')
It will then find an integer handle number not in use and will populate the Number property with that.

Azzi Abdelmalek
Azzi Abdelmalek el 20 de Abr. de 2016
  1 comentario
Walter Roberson
Walter Roberson el 20 de Abr. de 2016
openfig did not usually return integer handles, and in R2014b and later, the Number property is empty if you do not have an integer figure handle.

Iniciar sesión para comentar.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by