set string values to static text

Hello
I am trying to create GUI to a generic tool, but i am struggling to set string values in text box.
s={'PLC1',
'PLC2'
'SCADA1',
'SCADA2'}
I tried to use the following commands
set(handles.uitable1, 'String', s);
and
set(handles.uitable1, 'String', string(s));
but it shows that ' NaN' on static text
what is the maximum number of characters that can be presnted on the static text?

5 Comments

Haitham - please clarify if you are setting a table with the s cell array of strings or are you setting a text control with the s. Your code
set(handles.uitable1, 'String', s);
suggests that you are using a table with the uitable1 handle but I don't think that String is a valid property for it. If I try using a text control, then so long as it is large enough, then all four (?) lines appear in it.
I tried them both, but it does work as well
set(handles.uitable1, 'String', s);
set(handles.listbox1, 'String', s);
set(handles.text32, 'String', s);
String is valid prpoerty but i treied data and value and both of them are not working.
But does uitable1 correspond to a table or text control?
yes it does correspond to a table named unitable1.
So you are trying to set a table with some data. I don't think that you are showing all of the correct code or perhaps you aren't showing us the correct error message. Can you provide more of your code and snapshots of what is appearing on your GUI.

Sign in to comment.

Answers (0)

Categories

Tags

Asked:

on 15 May 2020

Commented:

on 16 May 2020

Community Treasure Hunt

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

Start Hunting!