Code covered by the BSD License

### Highlights from General Extra Toolbox

2.5
2.5 | 4 ratings Rate this file 11 Downloads (last 30 days) File Size: 32.5 KB File ID: #1309 Version: 1.0

# General Extra Toolbox

### Frederico D'Almeida (view profile)

11 Feb 2002 (Updated )

Generic functions for matrix manipulation, image processing, etc.

File Information
Description

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.

MATLAB release MATLAB 5.2 (R10)
Tags for This File   Please login to tag files.
Comments and Ratings (5)
17 Feb 2004 David Stickland

I used gmax and found it to be a very useful extension of the max function. Thank you.

12 Mar 2003 Frederico D'Almeida

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.

Comment only
11 Feb 2003 Valeri Karlov

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);
% Non-sparse
tic
xc = A\d;
toc
tic
xt = thomas(A,d);
toc
% Sparse
A_s = sparse(A);
tic
xc_s= A_s\d;
toc
tic
xt_s = thomas(A_s,d);
toc

Result:
elapsed_time (non-sparse, x = A\d) =
2.8900
elapsed_time (non-sparse, thomas.m) =
5.8910
elapsed_time (sparse, x = A\d) =
0.0160
elapsed_time (sparse, thomas.m) =
4.9690

15 Feb 2002 Duane Hanselman

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.

14 Feb 2002