How to get the handle of simulink window in matlab

조회 수: 13 (최근 30일)
QiQin Zhan
QiQin Zhan 2015년 3월 19일
댓글: Jan 2022년 2월 6일
I want to embed the simulation result of simMechanics into my self-created GUI. So I think the first thing I should do is to get the handle of simMechanics window. I know there must be some way to get it.But how? Any suggestion would be appreciated.

답변 (1개)

Al Dente
Al Dente 2015년 4월 2일
you can try using findall(0) -- root matlab handle, then looping over all the handles to find the right handle. What I wanted to do in my application is to search for an open Signal Builder window so I did this:
hndls = findall(0);
Tags = arrayfun(@(x)get(x, 'Tag'), hndls, 'UniformOutput', 0);
sigbuilderwin = hndls(strcmp(Tags, 'SignalBuilderGUI'));
Hope this helps
  댓글 수: 1
Jan
Jan 2022년 2월 6일
Easier:
sigbuilderwin = findall(groot, 'Tag', 'SignalBuilderGUI');

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by