Get function output and time from timit

I have functions I need to time, which returns a single output. All functions are in separate files. How do I get that returned output when using timeit?
So far I have used tic,toc. But want to use timeit from now on.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 20 de En. de 2018

0 votos

You cannot get the actual function output from timeit.
You can look in the File Exchange for the code for timeit and modify that code to suit your needs.
Remember that timeit runs the code a variable number of times.

3 comentarios

Sndn_Shr
Sndn_Shr el 20 de En. de 2018
I see. Means the timing we get from timeit is an average of several cycles?
Walter Roberson
Walter Roberson el 20 de En. de 2018
Read the documentation. It clearly says that timeit runs the code several times and takes the median.
Sndn_Shr
Sndn_Shr el 20 de En. de 2018
Thanks!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 20 de En. de 2018

Comentada:

el 20 de En. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by