Speed comparison of two functions using tic/toc
Mostrar comentarios más antiguos
Hi, I am supposed to write a function and then to compare my code with built-in MATLAB-function (A\b), how can I do it? I know I can use tic toc function like this:
function [ z ] = My_Function(A,b)
tic
my code
toc
%Comparison with built-in
tic
MATLABfunction(A,b)
toc
end
But is there any function i could use to do deeper comparison and print the results? I would like the output of my function to look like this:
My_Function(A,b)
ans =
...
Time elapsed using your function is: XY seconds, time elapsed using built-in MATLAB function is YX seconds.
Thank you very much in advance
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!