how make mini command window

조회 수: 16 (최근 30일)
naimah lubis
naimah lubis 2011년 11월 17일
hi all, anyone know how make mini command window?? i want some output of my program can display in mini command window on same frame with the program..

답변 (1개)

Jan
Jan 2011년 11월 17일
"Mini-command-window" implies, that you can start commands from this window. But there is one command window only. Do you want do reduce its size programatically? Then try: FEX: CmdWinTool.
If you only want to display some text:
function FigureHandle = ListText(FigureHandle, Str)
if nargin == 0
FigureHandle = figure;
ListH = uicontrol('Style', 'listbox', 'String', {}, ...
'Min', 0, 'Max', 2, 'Value', [], ...
'Units', 'normalized', ...
'Position', [0, 0, 1, 1]);
set(FigureHandle, 'UserData', ListH);
else
Str = cellstr(Str);
ListH = get(FigureHandle, 'UserData');
Str = cat(1, get(ListH, 'String'), Str(:));
set(ListH, 'String', Str, 'ListBoxTop', length(Str));
end
drawnow;
Now you can call this function like this:
ListFig = ListText;
for i = 1:20
pause(0.5);
ListText(ListFig, datestr(now, 0));
end

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by