Is it "ok" to convert new graphics object handles to double handles?

5 次查看(过去 30 天)
The R2014b release notes say "you should not perform operations that assume or require graphics handles to be numeric values", such as "combine handles with data in numeric arrays"
Unfortunately i have some old code that does exactly that. But i can just convert the object handle to an old fashioned numeric handle by wrapping it with double(). For backward compatibility, this is the easiest thing for me to do. (Changing the array to a cell array would break old saved states of the GUI)
So is there any reason that i shouldn't just convert the object handle to a double? Will this capability be removed soon?
  1 个评论
Star Strider
Star Strider 2014-11-6
I had no idea this was even possible. I’d be sure to save a backup copy of my code (and not delete R2014a), then convert them and see what the result is.
Good luck! Let us know.

请先登录,再进行评论。

采纳的回答

Michelle Hirsch
Michelle Hirsch 2014-11-7
You've got the right idea. This capability is provided to help make it easier to update code to work with the new graphics system, but should not be used as a permanent fix. We don't have a specific plan for how long the double command will keep working.
Instead of converting the array to a cell array, I'd probably look for other options to separate out the graphics objects from other data. Perhaps split them into two arrays? It's hard without looking at your code, but maybe if you keep the positions in the arrays the same it would be easier to update your code.
Good luck.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by