When the gui main program is running, I use findobj('Name', 'Gui_Main_Program');
This command does not work in timer callback function. It neither work in Matlab command window.
I see everyone says do not use global variables, so I put data in gui_main_hObject.UserData.
Thank you.

2 个评论

The first argument to findobj must the the handle to the object you want to use it with.
No, https://www.mathworks.com/help/matlab/ref/findobj.html shows multiple syntaxes in which there is no object passed

请先登录,再进行评论。

 采纳的回答

Either there is no object with exactly that name, or else the handle of it is not visible.
What shows up for
get(findall('type', 'figure'), 'Name')

3 个评论

It shows
Invalid handles passed to findall.
Where do I get or set whether the handle is visible?
I solved my problem by using a global variable.
get(findall(0, 'type', 'figure'), 'Name')
I keep forgetting that findall requires a first parameter
This one works.
Thank you Walter!

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

产品

版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by