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
Geoff Hayes
2020년 5월 15일
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
2020년 5월 15일
Geoff Hayes
2020년 5월 15일
But does uitable1 correspond to a table or text control?
Haitham Hassan
2020년 5월 15일
Geoff Hayes
2020년 5월 16일
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.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!