필터 지우기
필터 지우기

tic toc command in MATLAB GUI

조회 수: 3 (최근 30일)
Chethan
Chethan 2013년 5월 15일
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.

답변 (3개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 15일
t=toc
Then display t in an edit text
  댓글 수: 2
Chethan
Chethan 2013년 5월 16일
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 2013년 5월 16일
t=toc
set(handles.edittext1,'string',num2str(t))

댓글을 달려면 로그인하십시오.


Sean de Wolski
Sean de Wolski 2013년 5월 16일
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 2013년 5월 16일
t = toc;
set(handles.time, 'String', sprintf('%g', t));

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by