how make mini command window

14 vues (au cours des 30 derniers jours)
naimah lubis
naimah lubis le 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..

Réponses (1)

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

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by