findobj does not work
조회 수: 6 (최근 30일)
이전 댓글 표시
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
Star Strider
2020년 3월 4일
The first argument to findobj must the the handle to the object you want to use it with.
Walter Roberson
2020년 3월 4일
No, https://www.mathworks.com/help/matlab/ref/findobj.html shows multiple syntaxes in which there is no object passed
채택된 답변
Walter Roberson
2020년 3월 4일
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
Walter Roberson
2020년 3월 4일
get(findall(0, 'type', 'figure'), 'Name')
I keep forgetting that findall requires a first parameter
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!