List of Matlab M-Files Used in ECE/CS/ME 539
Last Modification: September 3, 2010
These Matlab M-Files are written by Yu Hen Hu, and have been
tested on Matlab V.7. You are welcomed to use them for education
and research purposese. For commercial applications (including
for-profit education services), please contact Prof. Hu at email@example.com .
If you spot mistakes in these routines, I will be happy to hear from
you to correct them. However, I am unable to provide free consultation
to solve your problem on hand. Nor will I help solving your homework
problem unless you are taking my class during the present semester.
If you are not familiar with Matlab, here are some
to learn it by yourself.
Back-propagation Multi-Layer Perceptron
- bp.m -- MLP backpropagation driver
program for classification tasks. (use utility
routines scale.m, and randomize.m.) Other mfiles
- bpconfig.m -- Initial
configurations of a MLP
- cvgtest.m -- Convergence test
routine (updated 10/16/01).
- bpdisplay.m -- Display
intermediate and final result of BP training
- bptest.m, bptestap.m
-- Test classification (bptest.m) and approximation (bptestap.m)
- rsample.m -- random sample K out
of Kr rows from matrix x.
- actfun.m, actfunp.m
-- Compute activation function and their derivatives.
- partunef.m -- partition the
training data samples x into a training set and a tuning
set according to a user specified percentage ratio
- fsplit.m -- Random partition a
matrix x row-wise according to ratio:1
- mlpdemo1.m -- demonstration of feedforward
MLP's output as function of its two input
- mlp2.m -- a specialized 2-layer feedforward
MLP network, called by mlpdemo1.m
Support Vector Machines
If you run clusterdemo.m and found error message, it is likely that
some of the routines call dist.m which conflicts with the built-in m-file
dist.m distributed by Mathwork, Inc. The patch is to change dist to mydist and
download mydist.m from the utility section. These programs have been updated on
Nov. 2008 and should not give that error any more.
Radial Basis Network
Time Series Analysis
- mademo.m -- Time series prediction
demonstration program using the moving average (MA) model.
Call mafun.m, and utility routines autocorr.m
- ardemo.m -- Time series prediction
demonstration program using the auto-regressive (AR)
model. Call utility routines
autocorr.m and tsgenf.m
Fuzzy Relation Composition Demonstration
Fuzzy Logic Control Example: Dog Chases Cat
Randsom Search Algorithm demonstration: Travelling Salesperson
- random_search.m -- demonstration of
various solutions of TSA problem using randsom search methods,
including exhaustive search (for 8 or fewer cities), genetic algorithm
(using tsa_ga.m), random-search, heurstic greedy search, simulated annealing
- tsp_ga.m -- Joseph Kirk's implementation of TSP solver
using genetic algorithm. Can be found at Matlab central.
- permugen.m -- generate all
permutations of tours
- nbgen.m -- generate all
permutations within a neighborhood of a specified
- rshift.m -- rotating shift of a
- dbmoon.m -- generate double moon data set shown
in Figure 1.8 of Haykin neural network and learning machines, 3rd edition
- shadeplot.m -- illustrating how to
plot a shaded area in a 2D region
- randomize.m -- randomize the
row order of a matrix
- sline.m -- given a line function,
compute the intersection of the line with the perimeter
of a 2D box so that the line can be plotted. called by
- datasepf.m -- generate two
classes of data samples within unit square that are
- scale.m -- called by bp.m to
linearly scale the input to a specified range.
- datagen.m -- 2D Gaussian Mixture
data generation. May generate rotated, elliptic Gaussian
clusteres. Labels can also be assigned. (Updated: 11/23/2005)datagen1.m -- variant of datagen.m.
- fungen.m -- generate 1 input, 1
output functions of (1) sinusoids; (2) piecewise linear
functions; or (3) polynomials. fungenf.m
-- callable function implementation of fungen.m
- polyfit1d.m -- fitting 1D data
to a polynomial
- mydist.m -- calculate distance between
two sets of points in L2, L1 and L_infinity norm
- autocorr.m -- calculate sample
auto-correlation or autocovariance lags using rectangular
window or triangular window.
- tsgenf.m -- generate time series
and corresponding training and testing matrices. AR
model, ligistic time series and rounding time series.
- xor -- XOR problem data file, M
= 2, N = 1
- and -- AND problem data file, M
= 2, N = 2
- parity4 -- 4-bit parity
problem data file, M = 4, N = 1
- parity7 training data, and
parity7 testing data -- 7-bit
parity problem data file M = 7, N = 1
- IRIS training data IRIS testing data IRIS
classification problem data file, M = 4, N = 3.