Contains several m files for matrix manipulation (grow, pad, roll, shift, scale, resize,...), matrix functions (count diferent elements, multi matrix max/min, set/get max/min values, fast tridiagonal system solver, fast max/min filter), matrix indexes manipulations, image functions (add noise, fast max/min filter, display image + marker image, posterize), colormap functions, search path functions, new 1D and 2D Fourier ploting style, etc.
I used gmax and found it to be a very useful extension of the max function. Thank you.
The help file is not clear, I must admit. If you use the form x = THOMAS(a,b,c,d) the result will be much faster. Try it.
I tried function thomas. It solves a tridiagonal linear system by an efficient Thomas method. But, how this function is implemented completely ignores Matlab's vectorization and sparse type. This makes even a straightforward Matlab's solution x = A\d ~twice faster (for large systems). But, using "sparce" simply makes the calculation instant (but not for thomas.m).
See the test attached:
n = 5000;
a = rand(n,1);
b = rand(n-1,1);
c = rand(n-1,1);
d = rand(n,1);
A = diag(a) + diag(b,1) + diag(c,-1);
xc = A\d;
xt = thomas(A,d);
A_s = sparse(A);
xt_s = thomas(A_s,d);
elapsed_time (non-sparse, x = A\d) =
elapsed_time (non-sparse, thomas.m) =
elapsed_time (sparse, x = A\d) =
elapsed_time (sparse, thomas.m) =
While I assume that the functions in this collection of M-files work, I note that many of the functions make use of the MATLAB function EVAL even though equivalent vectorized solutions exist. As a result, many of the functions run orders of magnitude slower than necessary. The functions addpaths, gmax, gmin, limindex, lim2cell, mmax, mmin, pad, resize, rmpaths, shift, subdim all use EVAL, when none need to. In addition, numerous functions are not computationally efficient. For example the simple function y=iseven(x) can be written as y=mod(x,2)==0; rather than by the three statements in iseven.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.