set string values to static text
Ältere Kommentare anzeigen
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 Kommentare
Geoff Hayes
am 15 Mai 2020
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.
Haitham Hassan
am 15 Mai 2020
Geoff Hayes
am 15 Mai 2020
But does uitable1 correspond to a table or text control?
Haitham Hassan
am 15 Mai 2020
Geoff Hayes
am 16 Mai 2020
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.
Antworten (0)
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!