Display array in GUI after pressing button

I have a GUI set up so that when I click the button, it displays an array in the workspace. How can I use a text box in my GUI to display this array when I click the button? The array I'm using is composed of several strings if that would change anything. Thanks!

 採用された回答

Orion
Orion 2014 年 11 月 10 日
編集済み: Orion 2014 年 11 月 10 日

1 投票

Hi,
Don't use a textbox.
use uitable, this way you can put any kind of data : numeric, string, logical,.. see the documentation

3 件のコメント

Joseph
Joseph 2014 年 11 月 11 日
All I need to do is display a list of names, would a uitable be simpler for doing that? I won't have any type of data other than strings. If uitable is the simplest, how would I go about doing that/making it respond to a button being pressed? This is the first GUI I've ever written.
Orion
Orion 2014 年 11 月 11 日
編集済み: Orion 2014 年 11 月 11 日
With a uitable, you can store a very long list easily. this graphic object come with a scrollbar, which will allow you to save space in your gui.
if you want to create it when you click on the pushbutton.
1) in guide, place the uitable, and set the visible property_ to off.
2) in your code, especially in the pushbutton callback, do something like :
set(handles.uitable1,'visible','on','Data',MyArrayOfString)
Joseph
Joseph 2014 年 11 月 12 日
Thank you! That helps so much!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

質問済み:

2014 年 11 月 10 日

コメント済み:

2014 年 11 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by