On a multi-core machine MIN(MIN(X)) seems to be faster than MIN(X(:)). On a single core (Matlab 2009a), MIN(X(:)) is 16% faster with the example of <us>. Follow <us> to be prepared for the future. Thanks <us>.
% ic2/2*2.6ghz/2gb/winxp.sp3/r2009b
x=rand(1000);
tic;for i=1:1000;min(x(:));end;toc
% Elapsed time is 1.469955 seconds.
tic;for i=1:1000;min(min(x));end;toc
% Elapsed time is 1.491293 seconds.
for smaller xes, its even faster...
just a thought
us
A short help text exists, but is not very descriptive. No H1-line. Year and author are mentioned. The automatic parsing of the help is impeded by using %% as comment chars. The source has no comments.
min(min(X)) would be a faster as min(X(:)), same for max. Pre-allocation of tempim is not needed.
Summary: It works, the function is useful, some improvements would be good.
Nice function, and one that I've come to rely on. It would be great if axes could span multiple columns/rows as you can do using the built-in subplot. Otherwise, great.
Comment only