openfig gives figure with no handle!

1 view (last 30 days)
Bill betz
Bill betz on 20 Apr 2016
Commented: Walter Roberson on 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 Comments
Charles Teasley
Charles Teasley on 20 Apr 2016
Edited: Charles Teasley on 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 on 20 Apr 2016
openfig() loads .fig file and returns its handle, so pv.fig was being loaded.

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 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 on 20 Apr 2016
  1 Comment
Walter Roberson
Walter Roberson on 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.

Sign in to comment.

Categories

Find more on Printing and Saving in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!