gca behaves different in 2014b
1 次查看(过去 30 天)
显示 更早的评论
Hello, Let assume there is already a figure open (like a GUI). Before 2014b with gca the handle number returned. Now with gca a new figure will open.
How could I get the current handle of a figure back?
In my special case, I try to get access to a certain axes of an existing figure. Any help avialable?
Thanks!
3 个评论
采纳的回答
更多回答(1 个)
David Barry
2014-10-12
Christian,
This seems to work fine. Are you sure you definitely have an axes in your figure? gca will only open a new figure with an axes in if you call it and one doesn't already exist.
Try the code below and see if returns 1
f = figure;
a = axes('Parent', f);
g = gca;
a == g
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!