Hi, How do I writing all elements of t edit8?
n=3;
for j=1:n
t(j)=n+1;
end
for i=1:n
set(handles.edit8,'string',t(i));
end

1 件のコメント

Adam Danz
Adam Danz 2019 年 4 月 29 日
This section
n=3;
for j=1:n
t(j)=n+1;
end
is the same as this
t = ones(1,n) * (n+1); % t = [4,4,4]
So, you want the text string to be '4 4 4' ?

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

回答 (1 件)

Adam Danz
Adam Danz 2019 年 4 月 29 日
編集済み: Adam Danz 2019 年 4 月 30 日

0 投票

(Continuing from comment section under the question)
No for-loop needed.
set(handles.edit8,'string',num2str(t))

2 件のコメント

Adam
Adam 2019 年 4 月 30 日
I assume you meant num2str?
Adam Danz
Adam Danz 2019 年 4 月 30 日
Thanks, Adam. I made the correction.

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

カテゴリ

ヘルプ センター および File Exchange で Characters and Strings についてさらに検索

質問済み:

2019 年 4 月 29 日

コメント済み:

2019 年 4 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by