openfig gives figure with no handle!

3 次查看(过去 30 天)
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 个评论
Charles Teasley
Charles Teasley 2016-4-20
编辑:Charles Teasley 2016-4-20
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 2016-4-20
openfig() loads .fig file and returns its handle, so pv.fig was being loaded.

请先登录,再进行评论。

回答(2 个)

Walter Roberson
Walter Roberson 2016-4-20
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 2016-4-20
  1 个评论
Walter Roberson
Walter Roberson 2016-4-20
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by