How to call some object handle from opening function of figure?

조회 수: 1 (최근 30일)
Ahmed Anas
Ahmed Anas 2020년 1월 30일
댓글: Rik 2020년 1월 31일
Hi Guys!
I have a figure containing a listbox and pushbutton. What i want is that on opening the GUI, the listbox string sets to some matrix stored in the same directory. I put some commands in the figure opening function, but could not get the desired results. In short , am unable to call the listbox object from the figure opening function.
Thanks in advance..
  댓글 수: 1
Adam
Adam 2020년 1월 30일
Assuming your are using GUIDE, which it sounds like you are, you should be able to simply call the listbox by the tag you gave it in the .fig file and then do whatever you want with it.
e.g.
handles.listbox1.String = ...

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

채택된 답변

Vladimir Sovkov
Vladimir Sovkov 2020년 1월 30일
u0=findobj('Tag','lst1','Style','listbox','Parent',gcf); % search for all the object properties you used to identify it
set(u0,'String',[1;2;3]); % set a vector of numbers or strings

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by