how make mini command window

1 Ansicht (letzte 30 Tage)
naimah lubis
naimah lubis am 17 Nov. 2011
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..

Antworten (1)

Jan
Jan am 17 Nov. 2011
"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

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by