set string values to static text
Mostra commenti meno recenti
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 Commenti
Geoff Hayes
il 15 Mag 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
il 15 Mag 2020
Geoff Hayes
il 15 Mag 2020
But does uitable1 correspond to a table or text control?
Haitham Hassan
il 15 Mag 2020
Geoff Hayes
il 16 Mag 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.
Risposte (0)
Categorie
Scopri di più su Characters and Strings in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!