Thread Subject: tic toc function

Subject: tic toc function

From: ching l

Date: 12 May, 2009 11:07:01

Message: 1 of 4

Hello there,

Is it possible just to get the "time" for the toc in seconds (i.e. 23.105489)
instead of the whole statement of "Elapsed time is 23.105489 seconds".

I need to have the value of the elapsed time in excel sheet, unfortunately,
excel sheet does not seem to read String/character.

Please advise.

Subject: tic toc function

From: Wayne King

Date: 12 May, 2009 11:15:06

Message: 2 of 4

Hi,

If you read

>> help toc or

>>doc toc

you will see that

Telapsed=toc;
saves the time in T as a double.

wayne

"ching l" <chinglnc@hotmail.com> wrote in message <gubl8l$sp5$1@fred.mathworks.com>...
> Hello there,
>
> Is it possible just to get the "time" for the toc in seconds (i.e. 23.105489)
> instead of the whole statement of "Elapsed time is 23.105489 seconds".
>
> I need to have the value of the elapsed time in excel sheet, unfortunately,
> excel sheet does not seem to read String/character.
>
> Please advise.

Subject: tic toc function

From: us

Date: 12 May, 2009 11:19:01

Message: 3 of 4

"ching l" <chinglnc@hotmail.com> wrote in message <gubl8l$sp5$1@fred.mathworks.com>...
> Hello there,
>
> Is it possible just to get the "time" for the toc in seconds (i.e. 23.105489)
> instead of the whole statement of "Elapsed time is 23.105489 seconds".
>
> I need to have the value of the elapsed time in excel sheet, unfortunately,
> excel sheet does not seem to read String/character.
>
> Please advise.

one of the solutions

     tic;
for i=1:100000
     rand;
end
     t=toc; % no display
     disp(t);
% 0.0088784

us

Subject: tic toc function

From: Nasser Abbasi

Date: 12 May, 2009 11:19:46

Message: 4 of 4


"ching l" <chinglnc@hotmail.com> wrote in message
news:gubl8l$sp5$1@fred.mathworks.com...
> Hello there,
>
> Is it possible just to get the "time" for the toc in seconds (i.e.
> 23.105489)
> instead of the whole statement of "Elapsed time is 23.105489 seconds".
>
> I need to have the value of the elapsed time in excel sheet,
> unfortunately,
> excel sheet does not seem to read String/character.
>
> Please advise.

EDU>> clear all
EDU>> tic
EDU>> t=toc;
EDU>> t

t =

    2.8080


--Nasser

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
toc us 12 May, 2009 07:24:04
code us 12 May, 2009 07:24:04
tic us 12 May, 2009 07:24:04
tic toc ching l 12 May, 2009 07:09:05
rssFeed for this Thread

Contact us at files@mathworks.com