Speed comparison of two functions using tic/toc
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!