Azzera filtri
Azzera filtri

tic toc command in MATLAB GUI

3 visualizzazioni (ultimi 30 giorni)
Chethan
Chethan il 15 Mag 2013
I'm using tic toc commands to know about the computation speed, however if i use this command it gives output in command window.
I need to minimize all GUI'S to check time taken by my code. How can i display time on GUI window? So, that user can easily estimate computation speed without minimizing any windows.

Risposte (3)

Azzi Abdelmalek
Azzi Abdelmalek il 15 Mag 2013
t=toc
Then display t in an edit text
  2 Commenti
Chethan
Chethan il 16 Mag 2013
I've used t=toc; at the end of my code. But, in edit text call back how can i display this t? also, i've used disp(get(handles.time,'string')); in my main code. Where, time is edit text function name. Not able to display time in text box.
Azzi Abdelmalek
Azzi Abdelmalek il 16 Mag 2013
t=toc
set(handles.edittext1,'string',num2str(t))

Accedi per commentare.


Sean de Wolski
Sean de Wolski il 16 Mag 2013
t = tic;
set(uicontrol('style','text'),'String',toc(t));
Use set to set the 'String' property of the textbox you care about.
doc set
For more info.

Jan
Jan il 16 Mag 2013
t = toc;
set(handles.time, 'String', sprintf('%g', t));

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by