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

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.
Geoff Hayes
Geoff Hayes 2020년 5월 15일
But does uitable1 correspond to a table or text control?
Haitham Hassan
Haitham Hassan 2020년 5월 15일
yes it does correspond to a table named unitable1.
Geoff Hayes
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에 대해 자세히 알아보기

태그

질문:

2020년 5월 15일

댓글:

2020년 5월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by