using script file
clear tic n = 1e4; fcn = cell(1,n); for ii = 1:n fcn{ii} = @(x)x+ii; end toc
Elapsed time is 3.289260 seconds. then using function file:
function mainclearticn = 1e4;fcn = cell(1,n);for ii = 1:n fcn{ii} = @(x)x+ii;endtoc
Elapsed time is 0.118427 seconds.
Best Answer