how to time a function in matlab code example Example: matlab time function f = @() myComputeFunction(x,y); % handle to function timeit(f)