how make mini command window

1 view (last 30 days)
naimah lubis
naimah lubis on 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..

Answers (1)

Jan
Jan on 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

Categories

Find more on Programming in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!