What should I do to display some information multi-line on the static text in the GUI?

2 ビュー (過去 30 日間)
Donghui  Sun
Donghui Sun 2013 年 12 月 12 日
コメント済み: reema 2014 年 6 月 1 日
I want to display some information on the static text compoment in the multi-line on the GUI.I use the loop:
for i = 1:5
str = sprintf('the number of %d is completely',i);
set(handles.myStaticText, 'String', str);
end
But the line will be erased by the next line.WHat should I do if I want to display in multi-line?

採用された回答

ES
ES 2013 年 12 月 12 日
if you want to append to existing string, get the string first and then append required data and display it. Example:
for i = 1:5
old_str=get(handles.text1, 'String');
tmp_str=['the number of',num2str(i),' is completely'];
new_str=[old_str; {tmp_str}];
set(handles.text1, 'String', new_str);
end
  2 件のコメント
Donghui  Sun
Donghui Sun 2013 年 12 月 12 日
Thanks, It does work.
reema
reema 2014 年 6 月 1 日
if i want to get information about person from database.and want to display on GUI then what we can do? like in (detection and recognition system).want to display the information about the recognized person on GUI then what me do? in matlab r2013a

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by