setting array to edittext with Matlab GUI
이전 댓글 표시
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
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개)
(Continuing from comment section under the question)
No for-loop needed.
set(handles.edit8,'string',num2str(t))
댓글 수: 2
Adam
2019년 4월 30일
I assume you meant num2str?
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!