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

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 日

0 投票

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

1 件のコメント

Rik
Rik 2020 年 1 月 31 日
Comment posted as answer by Ahmed Anas:
Thanks, a lot Sir.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

製品

リリース

R2016a

タグ

質問済み:

2020 年 1 月 30 日

コメント済み:

Rik
2020 年 1 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by