how to Display texts which are written in Command window in GUI (i.e in a static text)
4 views (last 30 days)
Show older comments
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!
0 Comments
Answers (1)
Andrés Castro
on 3 Mar 2020
Edited: Andrés Castro
on 4 Mar 2020
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!
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!