Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Elapsed time in workspace

Subject: Elapsed time in workspace

From: Yannis

Date: 17 Nov, 2010 12:21:04

Message: 1 of 7

Dear all,
I am working on my thesis project and in this point i need to estimate the computational load of the program. For this reason, in a for-loop i insert the tic/toc command. However, i need the results of the elapsed time to be in my workspace instead of my command window. Is there any way to do this?
Thanks in advance!!

Subject: Elapsed time in workspace

From: Aurelien Queffurust

Date: 17 Nov, 2010 12:32:03

Message: 2 of 7

"Yannis " <giannakosv@gmail.com> wrote in message <ic0hbf$kdv$1@fred.mathworks.com>...
> Dear all,
> I am working on my thesis project and in this point i need to estimate the computational load of the program. For this reason, in a for-loop i insert the tic/toc command. However, i need the results of the elapsed time to be in my workspace instead of my command window. Is there any way to do this?
> Thanks in advance!!

It is not clear ...which workspace are you talking about?

Subject: Elapsed time in workspace

From: Yannis

Date: 17 Nov, 2010 12:39:04

Message: 3 of 7

I need the results of elapsed time to be in a form of matrix, so that i can make calculations with them, in the workspace next to my command window. Sorry if i am not being understood, i am a bit of a rookie here..

"Aurelien Queffurust" <tug83@yahoo.fr> wrote in message <ic0i03$1mi$1@fred.mathworks.com>...
> "Yannis " <giannakosv@gmail.com> wrote in message <ic0hbf$kdv$1@fred.mathworks.com>...
> > Dear all,
> > I am working on my thesis project and in this point i need to estimate the computational load of the program. For this reason, in a for-loop i insert the tic/toc command. However, i need the results of the elapsed time to be in my workspace instead of my command window. Is there any way to do this?
> > Thanks in advance!!
>
> It is not clear ...which workspace are you talking about?

Subject: Elapsed time in workspace

From: Yannis

Date: 17 Nov, 2010 12:43:05

Message: 4 of 7

I need the results of elapsed time to be in a form of matrix, so that i can make calculations with them, in the workspace next to my command window. Sorry if i am not being understood, i am a bit of a rookie here..

"Aurelien Queffurust" <tug83@yahoo.fr> wrote in message <ic0i03$1mi$1@fred.mathworks.com>...
> "Yannis " <giannakosv@gmail.com> wrote in message <ic0hbf$kdv$1@fred.mathworks.com>...
> > Dear all,
> > I am working on my thesis project and in this point i need to estimate the computational load of the program. For this reason, in a for-loop i insert the tic/toc command. However, i need the results of the elapsed time to be in my workspace instead of my command window. Is there any way to do this?
> > Thanks in advance!!
>
> It is not clear ...which workspace are you talking about?

Subject: Elapsed time in workspace

From: Bruno Luong

Date: 17 Nov, 2010 12:48:03

Message: 5 of 7

"Yannis " <giannakosv@gmail.com> wrote in message <ic0hbf$kdv$1@fred.mathworks.com>...
> Dear all,
> I am working on my thesis project and in this point i need to estimate the computational load of the program. For this reason, in a for-loop i insert the tic/toc command. However, i need the results of the elapsed time to be in my workspace instead of my command window. Is there any way to do this?
> Thanks in advance!!

for i=1:something
  tic
  yourcommand;
  ...
  timearray(i) = toc;
end

Preallocate and set the size of timearray appropriately

Bruno

Subject: Elapsed time in workspace

From: Aurelien Queffurust

Date: 17 Nov, 2010 12:52:04

Message: 6 of 7

"Yannis " <giannakosv@gmail.com> wrote in message <ic0ikp$cjb$1@fred.mathworks.com>...
> I need the results of elapsed time to be in a form of matrix, so that i can make calculations with them, in the workspace next to my command window. Sorry if i am not being understood, i am a bit of a rookie here..
>
> "Aurelien Queffurust" <tug83@yahoo.fr> wrote in message <ic0i03$1mi$1@fred.mathworks.com>...
> > "Yannis " <giannakosv@gmail.com> wrote in message <ic0hbf$kdv$1@fred.mathworks.com>...
> > > Dear all,
> > > I am working on my thesis project and in this point i need to estimate the computational load of the program. For this reason, in a for-loop i insert the tic/toc command. However, i need the results of the elapsed time to be in my workspace instead of my command window. Is there any way to do this?
> > > Thanks in advance!!
> >
> > It is not clear ...which workspace are you talking about?

still not clear but for my understanding you have a function and you want to send the results in the "base" workspace" ... in this case use assignin or save your values in a mat-file ...

Subject: Elapsed time in workspace

From: Walter Roberson

Date: 17 Nov, 2010 16:23:20

Message: 7 of 7

On 17/11/10 6:21 AM, Yannis wrote:

> I am working on my thesis project and in this point i need to estimate
> the computational load of the program. For this reason, in a for-loop i
> insert the tic/toc command

Elapsed time is not a good estimate of computational load if the
hardware has multiple CPUs or multiple cores or hyperthreading.

Tags for this Thread

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.

Contact us