필터 지우기
필터 지우기

how to Display texts which are written in Command window in GUI (i.e in a static text)

조회 수: 10 (최근 30일)
MoHa
MoHa 2020년 3월 3일
댓글: MoHa 2020년 3월 4일
Hi everybody,
i have a function in my GUI, that generated allways some Result in Command Window. I want to display all of them in a box (static or edit text) in my GUI during running the function.
i can not use set() because every two line of my code has an output. something like this doesn't help :))))))
for Example:
for i=1:10
a=char([num2str(i) ' hiiiiiii']);
sprintf('%s ',a)
set(handles.edit1,'String',a);
pause(0.1)
set(handles.edit1,'String','other output');
end
hwo can i do that?
Thanks for your Help!

답변 (1개)

Andrés Castro
Andrés Castro 2020년 3월 3일
편집: Andrés Castro 2020년 3월 4일
Hi MoHa:
Let me see if i understood you question. Do you want to print in the GUI something that you can print in comand window?
You can try with this code:
f = figure;
v = 1:10
for i = 1: length(v)
str = num2str(v(i));
c = uicontrol ('Style','text','String',str,'Position', [100 100 100 100]);
pause(2)
end
Regards!
  댓글 수: 1
MoHa
MoHa 2020년 3월 4일
Hi Andres,
it was an Example output of my code. there are in my callbackFunction several output, which they are written in my Command window. but they are not visible in the GUI. I want to show all my output (textes in command window) in a box or static textbox in GUI.
your code shows just one Output and the History of Outputs are not visible.
something like that:
but i couldnt use this.
thanks for your answer.
regards

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by