Selected Matlab Functions

This page contains the list of selected Matlab functions that are available in the computer laboratories of the Department of Statistics and Operations Research. The files not included in this list are various example functions, examples presented during lectures and other files not intended for general use. In the labs the Matlab related files are stored in the folder Q:\Matlab.  Note that the drive Q is accessible for reading only. All functions follow the Matlab convention of the description by comments included immediately after the heading. So use the Matlab command >>help f to display the description of the function f. Use >>type f to view the code. The description gives an example of the use of the function that you can copy and paste to the command line. Note that the purpose of all functions is a clear demonstration of the implementation of theoretical concepts in Matlab and user friendliness, not the speed of computation. These are the functions listed by categories:

Visualization

contourshow displays contours of a scalar function of 2 scalar arguments.

contourshowv displays contours of a scalar function of one 2-vector argument.

fshow displays the graph of a univariate scalar function.

fshowstyle displays the graph of a univariate scalar function with the possibility to control the line properties.

fshow3D displays a 3D mesh of a scalar function of 2 scalar arguments.

fshow3Dv displays a 3D mesh of a scalar function of one 2-vector argument.

symshow shows the graph of a univariate scalar symbolic function with argument x.

symshow3D shows the mesh of a 2-dimensional scalar symbolic function with arguments x and y.

Line Search Algorithms

bisection finds a root of a univariate scalar function by using the bisection search algorithm.

dichotomous finds a minimum of a univariate scalar function by using the dichotomous search algorithm.

golden finds a root of a univariate scalar function by using the golden section search algorithm.

Note: for the Newton method use its multivariate version listed in the next section (see help).

Multivariate Unconstrained Optimization Algorithms

cyclic finds a minimum of a multivariate scalar function by using the cyclic co-ordinate algorithm.

cyclic_show finds a minimum of a bivariate scalar function by using the cyclic co-ordinate algorithm. Search steps are shown on function contours.

DFPsearch finds a minimum of a multivariate scalar function by using the Davidon-Fletcher-Powell quasi-Newton algorithm.

DFPsearch_show finds a minimum of a bivariate scalar function by using the Davidon-Fletcher-Powell quasi-Newton algorithm. Search steps are shown on function contours.

flambda is a "cross section" univariate function that is generated from a multivariate function for given starting point and given direction.

fletcherreeves finds a minimum of a multivariate scalar function by using the Fletcher-Reeves conjugate gradient algorithm.

fletcherreeves_show finds a minimum of a bivariate scalar function by using the Fletcher-Reeves conjugate gradient algorithm. Search steps are shown on function contours.

grad_ient finds a minimum of a multivariate scalar function by using the gradient = steepest descent algorithm.

gradient_show finds a minimum of a bivariate scalar function by using the gradient (steepest descent) algorithm. Search steps are shown on function contours.

hookejeeves finds a minimum of a multivariate scalar function by using the Hooke-Jeeves algorithm.

hookejeeves_show finds a minimum of a bivariate scalar function by using the Hooke-Jeeves algorithm. Search steps are shown on function contours.

neldermead finds a minimum of a multivariate scalar function by using the Nelder - Mead (moving simplex) algorithm.

neldermead_show finds a minimum of a bivariate scalar function by using the Nelder - Mead (moving simplex) algorithm. Search steps are shown on function contours.

newton finds a minimum of a multivariate scalar function by using the Newton's method. Hessian is supposed to be non-singular.

newton_show finds a minimum of a bivariate scalar function by using the Newton's method. Hessian is supposed to be non-singular. Search steps are shown on function contours.

Queueing Theory

erlang computes the loss probability of the M/M/c/c system. Fast version - does not use poisspdf of Matlab.

jacksonnet solves a stable open Jackson network made of single channel stations.

jacksonnetc solves a stable open Jackson network made of multichannel stations.

jacksonnetcls solves a stable open Jackson network made of multichannel stations and classes of customers.

Linear Programming

pivot pivoting a matrix at given row and column. For zero pivot item no operation, otherwise no other tests.

simplex is a script that solves the LP problem Max z = c'x, ST Ax <= b, x >= 0.

simplex1 is a script that solves the LP problem: Max z = c'x, ST Ax <= b, x >= 0 by matrix (no table) approach. Shows all partial results with comments.

simplex2 is a script that solves the LP problem: Max z = c'x, ST Ax <= b, x >= 0 by matrix (no table) approach. Fast version, shows just the final results.

Various

fibonacci1 returns a Fibonacci number. Direct nonrecursive implementation.

fibonacci2 returns a Fibonacci number. Implementation by recursion.

fib1 measures time spent by fibonacci1.

fib2 measures time spent by fibonacci2. Note the difference, try for N > 30.

 


[ Home | University of Malta | Department of Statistics & OR ]