openfig gives figure with no handle!

2 visualizzazioni (ultimi 30 giorni)
Bill betz
Bill betz il 20 Apr 2016
Commentato: Walter Roberson il 20 Apr 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 Commenti
Charles Teasley
Charles Teasley il 20 Apr 2016
Modificato: Charles Teasley il 20 Apr 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 il 20 Apr 2016
openfig() loads .fig file and returns its handle, so pv.fig was being loaded.

Accedi per commentare.

Risposte (2)

Walter Roberson
Walter Roberson il 20 Apr 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 il 20 Apr 2016
  1 Commento
Walter Roberson
Walter Roberson il 20 Apr 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.

Accedi per commentare.

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by