matlab reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/appliedmaths/matlabreference.pdf ·...

23
Matlab Reference --------------------------------------------------------------------- --- MATLAB's Main Categories of Functions --------------------------------------------------------------------- --- general General purpose commands. ops Operators and special characters. lang Language constructs and debugging. elmat Elementary matrices and matrix manipulation. specmat Specialized matrices. elfun Elementary math functions. specfun Specialized math functions. matfun Matrix functions - numerical linear algebra. datafun Data analysis and Fourier transform functions. polyfun Polynomial and interpolation functions. funfun Function functions - nonlinear numerical methods. sparfun Sparse matrix functions. plotxy Two dimensional graphics. plotxyz Three dimensional graphics. graphics General purpose graphics functions. color Color control and lighting model functions. sounds Sound processing functions. strfun Character string functions. iofun Low-level file I/O functions. external External interface library demos Demonstrations and samples General Purpose Commands --------------------------------------------------------------------- ---------- Managing Commands and Functions --------------------------------------------------------------------- ---------- demo Run demos. expo Run MATLAB EXPO demonstration program. help Online documentation. info Information about MATLAB and The MathWorks. lasterr Last error message generated. lookfor Keyword search through the help entries. path Control MATLAB's search path. subscribe Become a subscribing MATLAB user. type List M-file. ver Current MATLAB and toolbox versions. version Current MATLAB version number. what Directory listing of M-, MAT- and MEX-files. whatsnew Display README files for MATLAB and toolboxes. which Locate functions and files. --------------------------------------------------------------------- ---------- --------------------------------------------------------------------- ---------- Managing Variables and the Workspace

Upload: hoangdat

Post on 04-Jun-2018

325 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Matlab Reference

---------------------------------------------------------------------

---

MATLAB's Main Categories of Functions

---------------------------------------------------------------------

---

general General purpose commands.

ops Operators and special characters.

lang Language constructs and debugging.

elmat Elementary matrices and matrix manipulation.

specmat Specialized matrices.

elfun Elementary math functions.

specfun Specialized math functions.

matfun Matrix functions - numerical linear algebra.

datafun Data analysis and Fourier transform functions.

polyfun Polynomial and interpolation functions.

funfun Function functions - nonlinear numerical methods.

sparfun Sparse matrix functions.

plotxy Two dimensional graphics.

plotxyz Three dimensional graphics.

graphics General purpose graphics functions.

color Color control and lighting model functions.

sounds Sound processing functions.

strfun Character string functions.

iofun Low-level file I/O functions.

external External interface library

demos Demonstrations and samples

General Purpose Commands

---------------------------------------------------------------------

----------

Managing Commands and Functions

---------------------------------------------------------------------

----------

demo Run demos.

expo Run MATLAB EXPO demonstration program.

help Online documentation.

info Information about MATLAB and The MathWorks.

lasterr Last error message generated.

lookfor Keyword search through the help entries.

path Control MATLAB's search path.

subscribe Become a subscribing MATLAB user.

type List M-file.

ver Current MATLAB and toolbox versions.

version Current MATLAB version number.

what Directory listing of M-, MAT- and MEX-files.

whatsnew Display README files for MATLAB and toolboxes.

which Locate functions and files.

---------------------------------------------------------------------

----------

---------------------------------------------------------------------

----------

Managing Variables and the Workspace

Page 2: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

---------------------------------------------------------------------

----------

clear Clear variables and functions from memory.

disp Display matrix or text.

length Length of vector.

load Retrieve variables from disk.

pack Consolidate workspace memory.

save Save workspace variables to disk.

size Size of matrix.

who List current variables.

whos List current variables, long form.

---------------------------------------------------------------------

----------

---------------------------------------------------------------------

----------------------------

Working with Files and the Operating Environment

---------------------------------------------------------------------

----------------------------

cd Change current working directory.

cedit Set command line editing parameters (UNIX only).

delete Delete file.

diary Save text of MATLAB session.

dir Directory listing.

getenv Get environment value.

hostid MATLAB server host identification number.

ls Directory listing.

matlabroot Root directory of MATLAB installation.

pwd Show current working directory.

tempdir Name of system temporary directory.

tempname Unique name for temporary file.

terminal Set graphics terminal type.

unix Execute operating system command; return result.

! Execute operating system command.

---------------------------------------------------------------------

----------------------------

---------------------------------------------------------------------

-

Controlling the Command Window

---------------------------------------------------------------------

-

clc Clear command window.

echo Echo commands inside script files.

format Set output format.

home Send cursor home.

more Control paged output in command window.

---------------------------------------------------------------------

-

---------------------------------------------------------------------

----

Starting and Quitting from MATLAB

---------------------------------------------------------------------

----

matlabrc Master startup M-file.

quit Terminate MATLAB.

startup M-file executed when MATLAB is invoked.

---------------------------------------------------------------------

----

Page 3: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Operators and Special Characters

-------------------------------------------------------------

Operators and Special Characters

-------------------------------------------------------------

+ Plus.

- Minus

* Matrix multiplication.

.* Array multiplication.

^ Matrix power.

.^ Array power.

kron Kronecker tensor product.

\ Backslash or left division.

/ Slash or right division.

./ Array division.

: Colon.

() Parentheses.

[] Brackets.

. Decimal point.

.. Parent directory.

... Continuation.

, Comma.

; Semicolon.

% Comment.

! Exclamation point.

' Transpose and quote.

.' Nonconjugated transpose.

= Assignment.

== Equality.

<> Relational operators.

& Logical AND.

| Logical OR.

~ Logical NOT.

xor Logical EXCLUSIVE OR.

-------------------------------------------------------------

----------------------------------------------------------

Logical Functions

----------------------------------------------------------

all True if all elements of vector are true.

any True if any element of vector is true.

exist Check if variables or functions exist.

find Find indices of nonzero elements.

finite True for finite elements.

isempty True for empty matrix.

ishold True if hold is on.

isieee True for IEEE floating-point arithmetic.

isinf True for infinite elements.

isletter True for alphabetic character.

isnan True for Not-A-Number.

isreal True if all matrix elements are real.

issparse True for sparse matrix.

isstr True for text string.

----------------------------------------------------------

Page 4: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Language Constructs and Debugging

---------------------------------------------------------------------

---

MATLAB as a Programming Language

---------------------------------------------------------------------

---

eval Execute string with MATLAB expression.

feval Execute function specified by string.

function Add new function.

global Define global variable.

nargchk Validate number of input arguments.

---------------------------------------------------------------------

---

------------------------------------------------------------------

Control Flow

------------------------------------------------------------------

break Terminate execution of loop.

else Used with if.

elseif Used with if.

end Terminate the scope of for, while and if statements.

error Display message and abort function.

for Repeat statements a specific number of times.

if Conditionally execute statements.

return Return to invoking function.

while Repeat statements an indefinite number of times.

------------------------------------------------------------------

---------------------------------------------------------------

Interactive Input

---------------------------------------------------------------

input Prompt for user input.

keyboard Invoke keyboard as if it were a script file.

menu Generate menu of choices for user input.

pause Wait for user response.

---------------------------------------------------------------

------------------------------------------

Debugging

------------------------------------------

dbclear Remove breakpoint.

dbcont Resume execution.

dbdown Change local workspace context.

dbquit Quit debug mode.

dbstack List who called whom.

dbstatus List all breakpoints.

dbstep Execute one or more lines.

dbstop Set breakpoint.

dbtype List M-file with line numbers.

dbup Change local workspace context.

mexdebug Enable MEX-file debugging.

------------------------------------------

Page 5: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Matrices and Matrix Manipulation

Elementary Matrices ---------------------------------------------------------------------

-

Elementary Matrices

---------------------------------------------------------------------

-

eye Identity matrix.

gallery Test matrices - matrix condition and eigenvalues.

linspace Linearly spaced vector.

logspace Logarithmically spaced vector.

meshgrid X and Y arrays for 3-D plots.

ones Ones matrix.

rand Uniformly distributed random numbers.

randn Normally distributed random numbers.

zeros Zeros matrix.

: Regularly spaced vector.

---------------------------------------------------------------------

-

---------------------------------------------------------------------

Special Variables and Constants

---------------------------------------------------------------------

ans Most recent answer.

computer Computer type.

eps Floating-point relative accuracy.

flops Count of floating-point operations.

i, j Imaginary unit.

inf Infinity.

NaN Not-a-Number.

nargin Number of function input arguments.

nargout Number of function output arguments.

pi 3.1415926535897....

realmax Largest floating-point number.

realmin Smallest floating-point number

---------------------------------------------------------------------

------------------------------------------

Time and Dates

------------------------------------------

clock Wall clock.

cputime Elapsed CPU time.

date Calendar.

etime Elapsed time function.

tic, toc Stopwatch timer functions.

------------------------------------------

-------------------------------------------------------------------

Matrix Manipulation

-------------------------------------------------------------------

diag Create or extract diagonals.

fliplr Flip matrix in the left/right direction.

flipud Flip matrix in the up/down direction.

isreal True for matrix containing real elements only.

reshape Change size.

rot90 Rotate matrix 90 degrees.

tril Extract lower triangular part.

Page 6: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

triu Extract upper triangular part.

: Index into matrix, rearrange matrix.

-------------------------------------------------------------------

Specialized Matrices ----------------------------------------------------------------

Specialized Matrices

----------------------------------------------------------------

compan Companion matrix.

hadamard Hadamard matrix.

hankel Hankel matrix.

hilb Hilbert matrix.

invhilb Inverse Hilbert matrix.

magic Magic square.

pascal Pascal matrix.

rosser Classic symmetric eigenvalue test problem.

toeplitz Toeplitz matrix.

vander Vandermonde matrix.

wilkinson Wilkinson's eigenvalue test matrix.

----------------------------------------------------------------

Math Functions

Elementary Functions ---------------------------------------------------------

Elementary Math Functions

---------------------------------------------------------

abs Absolute value.

acos Inverse cosine.

acosh Inverse hyperbolic cosine.

acot Inverse cotangent.

acoth Inverse hyperbolic cotangent.

acsc Inverse cosecant.

acsch Inverse hyperbolic cosecant.

angle Phase angle.

asec Inverse secant.

asech Inverse hyperbolic secant.

asin Inverse sine.

asinh Inverse hyperbolic sine.

atan Inverse tangent.

atan2 Four quadrant inverse tangent.

atanh Inverse hyperbolic tangent.

ceil Round towards plus infinity.

conj Complex conjugate.

cos Cosine.

cosh Hyperbolic cosine.

cot Cotangent.

coth Hyperbolic cotangent.

csc Cosecant.

csch Hyperbolic cosecant.

exp Exponential.

fix Round towards zero.

floor Round towards minus infinity.

gcd Greatest common divisor.

imag Complex imaginary part.

lcm Least common multiple.

log Natural logarithm.

log10 Common logarithm.

Page 7: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

real Complex real part.

rem Remainder after division.

round Round towards nearest integer.

sec Secant.

sech Hyperbolic secant.

sign Signum function.

sin Sine.

sinh Hyperbolic sine.

sqrt Square root.

tan Tangent.

tanh Hyperbolic tangent.

---------------------------------------------------------

Specialized Math Functions ---------------------------------------------------------------------

----

Specialized Math Functions

---------------------------------------------------------------------

----

bessel Bessel functions.

besseli Modified Bessel functions of the first kind.

besselj Bessel functions of the first kind.

besselk Modified Bessel functions of the second kind.

bessely Bessel functions of the second kind.

beta Beta function.

betainc Incomplete beta function.

betaln Logarithm of beta function.

ellipj Jacobi elliptic functions.

ellipke Complete elliptic integral.

erf Error function.

erfc Complementary error function.

erfcx Scaled complementary error function.

erfinv Inverse error function.

expint Exponential integral.

gamma Gamma function.

gammainc Incomplete gamma function.

gammaln Logarithm of gamma function.

legendre Associated Legendre functions.

log2 Dissect floating point numbers.

pow2 Scale floating point numbers.

rat Rational approximation.

rats Rational output.

---------------------------------------------------------------------

----

Page 8: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Matrix Functions - Numerical Linear

Algebra

----------------------------------------------------------------

Matrix Analysis

----------------------------------------------------------------

cond Matrix condition number.

det Determinant.

etree Elimination tree of a matrix.

norm Matrix or vector norm.

null Null space.

orth Orthogonalization.

rcond LINPACK reciprocal condition estimator.

rank Number of linearly independent rows or columns.

rref Reduced row echelon form.

subspace Angle between two subspaces.

trace Sum of diagonal elements.

----------------------------------------------------------------

-------------------------------------------------------------------

Linear Equations

-------------------------------------------------------------------

chol Cholesky factorization.

inv Matrix inverse.

lscov Least squares in the presence of known covariance.

lu Factors from Gaussian elimination.

nnls Non-negative least-squares.

pinv Pseudoinverse.

qr Orthogonal-triangular decomposition.

\ and / Linear equation solution.

-------------------------------------------------------------------

---------------------------------------------------------------------

-------------

Eigenvalues and Singular Values

---------------------------------------------------------------------

-------------

balance Diagonal scaling to improve eigenvalue accuracy.

cdf2rdf Complex diagonal form to real block diagonal form.

eig Eigenvalues and eigenvectors.

hess Hessenberg form.

poly Characteristic polynomial.

qz Generalized eigenvalues.

rsf2csf Real block diagonal form to complex diagonal form.

schur Schur decomposition.

svd Singular value decomposition.

---------------------------------------------------------------------

-------------

---------------------------------------------------

Matrix Functions

---------------------------------------------------

expm Matrix exponential.

funm Evaluate general matrix function.

logm Matrix logarithm.

sqrtm Matrix square root.

---------------------------------------------------

Page 9: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

----------------------------------------------------------

Low Level Functions

----------------------------------------------------------

qrdelete Delete columns from QR factorization.

qrinsert Insert columns into QR factorization.

----------------------------------------------------------

Data Analysis and Fourier Transform

Functions

----------------------------------------------------------------

Basic Operations

----------------------------------------------------------------

cumprod Cumulative product of elements.

cumsum Cumulative sum of elements.

max Largest component.

mean Average or mean value.

median Median value.

min Smallest component.

prod Product of elements.

sort Sort in ascending order.

std Standard deviation.

sum Sum of elements.

trapz Numerical integration using trapezoidal method.

----------------------------------------------------------------

-------------------------------------------------------------------

Finite Differences

-------------------------------------------------------------------

del2 Five-point discrete Laplacian.

diff Difference function and approximate derivative.

gradient Approximate gradient.

-------------------------------------------------------------------

-------------------------------------

Correlation

-------------------------------------

corrcoef Correlation coefficients.

cov Covariance matrix.

-------------------------------------

---------------------------------------------------------------------

Filtering and Convolution

---------------------------------------------------------------------

conv Convolution and polynomial multiplication.

conv2 Two-dimensional convolution.

deconv Deconvolution and polynomial division.

filter One-dimensional digital filter.

filter2 Two-dimensional digital filter.

---------------------------------------------------------------------

---------------------------------------------------------------------

-

Fourier Transforms

---------------------------------------------------------------------

-

abs Magnitude.

angle Phase angle.

cplxpair Sort numbers into complex conjugate pairs.

fft Discrete Fourier transform.

fft2 Two-dimensional discrete Fourier transform.

Page 10: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

fftshift Move zeroth lag to center of spectrum.

ifft Inverse discrete Fourier transform.

ifft2 Two-dimensional inverse discrete Fourier transform.

nextpow2 Next higher power of 2.

unwrap Remove phase angle jumps across 360\xa1 boundaries.

---------------------------------------------------------------------

-

---------------------------------------

Vector Functions

---------------------------------------

cross Vector cross product.

dot Vector dot product.

---------------------------------------

Polynomial and Interpolation Functions

-------------------------------------------------------

Polynomials

-------------------------------------------------------

conv Multiply polynomials.

deconv Divide polynomials.

poly Construct polynomial with specified roots.

polyder Differentiate polynomial.

polyeig Solve polynomial eigenvalue problem.

polyfit Fit polynomial to data.

polyval Evaluate polynomial.

polyvalm Evaluate polynomial with matrix argument.

residue Partial-fraction expansion (residues).

roots Find polynomial roots.

-------------------------------------------------------

---------------------------------------------------------------------

Data Interpolation

---------------------------------------------------------------------

griddata Data gridding.

interp1 One-dimensional interpolation (1-D table lookup).

interp2 Two-dimensional interpolation (2-D table lookup).

interpft One-dimensional interpolation using FFT method.

---------------------------------------------------------------------

Function Functions

---------------------------------------------------------------------

------------------------------

Function Functions - Nonlinear Numerical Methods

---------------------------------------------------------------------

------------------------------

fmin Minimize function of one variable.

fmins Minimize function of several variables.

fplot Plot function.

fzero Find zero of function of one variable.

ode23 Solve differential equations, low order method.

ode45 Solve differential equations, high order method.

quad Numerically evaluate integral, low order method.

quad8 Numerically evaluate integral, high order method.

---------------------------------------------------------------------

------------------------------

Page 11: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Sparse Matrix Functions

----------------------------------------------------------------

Elementary Sparse Matrices

----------------------------------------------------------------

spdiags Sparse matrix formed from diagonals.

speye Sparse identity matrix.

sprandn Sparse random matrix.

sprandsym Sparse symmetric random matrix.

----------------------------------------------------------------

---------------------------------------------------------------------

------

Full to Sparse Conversion

---------------------------------------------------------------------

------

find Find indices of nonzero entries.

full Convert sparse matrix to full matrix.

sparse Create sparse matrix from nonzeros and indices.

spconvert Convert from sparse matrix external format.

---------------------------------------------------------------------

------

---------------------------------------------------------------------

----------------------------

Working with Nonzero Entries of Sparse Matrices

---------------------------------------------------------------------

----------------------------

issparse True if matrix is sparse.

nnz Number of nonzero entries.

nonzeros Nonzero entries.

nzmax Amount of storage allocated for nonzero entries.

spalloc Allocate memory for nonzero entries.

spfun Apply function to nonzero entries.

spones Replace nonzero entries with ones.

---------------------------------------------------------------------

----------------------------

-------------------------------------------------------------

Visualizing Sparse Matrices

-------------------------------------------------------------

gplot Plot graph, as in "graph theory."

spy Visualize sparsity structure.

-------------------------------------------------------------

------------------------------------------------------------

Reordering Algorithms

------------------------------------------------------------

colmmd Column minimum degree.

colperm Order columns based on nonzero count.

dmperm Dulmage-Mendelsohn decomposition.

randperm Random permutation vector.

symmmd Symmetric minimum degree.

symrcm Reverse Cuthill-McKee ordering.

------------------------------------------------------------

------------------------------------------------------------

Norm, Condition Number, and Rank

------------------------------------------------------------

condest Estimate 1-norm condition.

normest Estimate 2-norm.

sprank Structural rank.

------------------------------------------------------------

---------------------------------------------------------

Page 12: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Miscellaneous

---------------------------------------------------------

spaugment Form least squares augmented system.

spparms Set parameters for sparse matrix routines.

symbfact Symbolic factorization analysis.

---------------------------------------------------------

Two-Dimensional Graphics

---------------------------------------------------------------

Elementary X-Y Graphs

---------------------------------------------------------------

fill Draw filled 2-D polygons.

loglog Log-log scale plot.

plot Linear plot.

semilogx Semi-log scale plot, x-axis logarithmic.

semilogy Semi-log scale plot, y-axis logarithmic.

---------------------------------------------------------------

-------------------------------------------------------------

Specialized X-Y Graphs

-------------------------------------------------------------

bar Bar graph.

comet Animated comet plot.

compass Compass plot.

errorbar Error bar plot.

feather Feather plot.

fplot Plot function.

hist Histogram plot.

polar Polar coordinate plot.

rose Angle histogram plot.

stairs Stairstep plot.

stem Stem plot for discrete sequence data.

-------------------------------------------------------------

------------------------------------------

Graph Annotation

------------------------------------------

grid Grid lines.

gtext Mouse placement of text.

legend Add legend to plot.

text Text annotation.

title Graph title.

xlabel X-axis label.

ylabel Y-axis label.

------------------------------------------

-------------------------------------------------------------

Coordinate System Conversion

-------------------------------------------------------------

cart2pol Cartesian to polar coordinates.

pol2cart Polar to Cartesian coordinates.

------------------------------------------------------------

---------------------------------------------------------

Miscellaneous

---------------------------------------------------------

zoom Zoom in and out of a two-dimensional plot.

---------------------------------------------------------

Three-Dimensional Graphics

Page 13: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

---------------------------------------------------------------------

------------

Line and Area Fill Commands

---------------------------------------------------------------------

------------

fill3 Draw filled three-dimensional polygons in 3-D space.

plot3 Plot lines and points in three-dimensional space.

---------------------------------------------------------------------

------------

---------------------------------------------------------------------

---------------

Contour and Other 2-D Plots of 3-D Data

---------------------------------------------------------------------

---------------

clabel Contour plot elevation labels.

comet3 Three-dimensional animated comet plot.

contour Contour plot.

contour3 Three-dimensional contour plot.

contourc Contour plot computation (used by contour).

image Display image.

imagesc Scale data and display as image.

pcolor Pseudocolor (checkerboard) plot.

quiver Quiver plot.

slice Volumetric slice plot.

---------------------------------------------------------------------

---------------

---------------------------------------------------------------------

-

Surface and Mesh Plots

---------------------------------------------------------------------

-

mesh Three-dimensional mesh surface.

meshc Combination mesh/contour plot.

meshz Three-dimensional mesh with zero plane.

slice Volumetric visualization plot.

surf Three-dimensional shaded surface.

surfc Combination surf/contour plot.

surfl Three-dimensional shaded surface with lighting.

waterfall Waterfall plot.

---------------------------------------------------------------------

-

------------------------------------------------------------------

Graph Appearance

------------------------------------------------------------------

axis Axis scaling and appearance.

caxis Pseudocolor axis scaling.

colormap Color lookup table.

hidden Mesh hidden line removal mode.

shading Color shading mode.

view Three-dimensional graph viewpoint specification.

viewmtx View transformation matrices.

------------------------------------------------------------------

----------------------------------------------------------

Graph Annotation

----------------------------------------------------------

grid Grid lines.

legend Add legend to plot.

text Text annotation.

title Graph title.

xlabel X-axis label.

ylabel Y-axis label.

Page 14: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

zlabel Z-axis label for three-dimensional plots.

----------------------------------------------------------

-------------------------------

3-D Objects

-------------------------------

cylinder Generate cylinder.

sphere Generate sphere.

-------------------------------

-------------------------------------------------------------

Coordinate System Conversion

-------------------------------------------------------------

cart2sph Cartesian to polar coordinates.

sph2cart Polar to Cartesian coordinates.

-------------------------------------------------------------

Graphics Functions

---------------------------------------------------------------------

-------------------

Figure Window Creation and Control

---------------------------------------------------------------------

-------------------

capture Screen capture of current figure (UNIX only).

clf Clear current figure.

close Close figure.

figure Create Figure (graph window).

gcf Get handle to current figure.

graymon Set default figure properties for grayscale monitors.

newplot Determine correct axes and figure for new graph.

refresh Redraw current figure window.

whitebg Toggle figure background color.

---------------------------------------------------------------------

-------------------

---------------------------------------------------------------

Axis Creation and Control

---------------------------------------------------------------

axes Create axes in arbitrary positions.

axis Control axis scaling and appearance.

caxis Control pseudocolor axis scaling.

cla Clear current axes.

gca Get handle to current axes.

hold Hold current graph.

ishold True if hold is on.

subplot Create axes in tiled positions.

---------------------------------------------------------------

-------------------------------------------------------

Handle Graphics Objects

-------------------------------------------------------

axes Create axes.

figure Create figure window.

image Create image.

line Create line.

patch Create patch.

surface Create surface.

text Create text.

uicontrol Create user interface control.

uimenu Create user interface menu.

-------------------------------------------------------

------------------------------------------------------------------

Page 15: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Handle Graphics Operations

------------------------------------------------------------------

delete Delete object.

drawnow Flush pending graphics events.

findobj Find object with specified properties.

gco Get handle of current object.

get Get object properties.

reset Reset object properties.

rotate Rotate an object.

set Set object properties.

------------------------------------------------------------------

----------------------------------------------------------------

Dialog Boxes

----------------------------------------------------------------

uigetfile Retrieve name of file to open through dialog box.

uiputfile Retrieve name of file to write through dialog box.

----------------------------------------------------------------

-------------------------------------------------------

Hardcopy and Storage

-------------------------------------------------------

orient Set paper orientation.

print Print graph or save graph to file.

printopt Configure local printer defaults.

-------------------------------------------------------

----------------------------------------------------

Movies and Animation

----------------------------------------------------

getframe Get movie frame.

movie Play recorded movie frames.

moviein Initialize movie frame memory.

----------------------------------------------------

----------------------------------------------------------

Miscellaneous

----------------------------------------------------------

ginput Graphical input from mouse.

ishold Return hold state.

rbbox Rubberband box for region selection.

waitforbuttonpress Wait for key/button press over figure.

----------------------------------------------------------

Color Control and Lighting Model

Functions

------------------------------------------

Color Controls

------------------------------------------

caxis Pseudocolor axis scaling.

colormap Color lookup table.

shading Color shading mode.

------------------------------------------

------------------------------------------------------------

Colormaps

------------------------------------------------------------

bone Gray-scale with a tinge of blue colormap.

contrast Contrast-enhancing grayscale colormap.

cool Shades of cyan and magenta colormap.

copper Linear copper-tone colormap.

flag Alternating red, white, blue, and black colormap.

Page 16: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

gray Linear grayscale colormap.

hsv Hue-saturation-value colormap.

hot Black-red-yellow-white colormap.

jet Variation of HSV colormap (no wrap).

pink Pastel shades of pink colormap.

prism Prism colors colormap.

white All white monochrome colormap.

------------------------------------------------------------

---------------------------------------------------------------------

----------

Color Map Related Functions

---------------------------------------------------------------------

----------

brighten Brighten or darken color map.

colorbar Display colormap as color scale.

hsv2rgb Hue-saturation-value to red-green-blue conversion.

rgb2hsv Red-green-blue to hue-saturation-value conversion.

rgbplot Plot color map.

spinmap Spin color map.

---------------------------------------------------------------------

----------

----------------------------------------------------------------

Lighting Models

----------------------------------------------------------------

diffuse Diffuse reflectance.

specular Specular reflectance.

surfl Three-dimensional shaded surface with lighting.

surfnorm Surface normals.

----------------------------------------------------------------

Sound Processing Functions

----------------------------------------------------

General Sound Functions

----------------------------------------------------

saxis Sound axis scaling.

sound Convert vector into sound.

----------------------------------------------------

-------------------------------------------------------------------

SPARCstation-specific Sound Functions

-------------------------------------------------------------------

auread Read Sun audio file.

auwrite Write Sun audio file.

lin2mu Linear to mu-law conversion.

mu2lin Mu-law to linear conversion.

-------------------------------------------------------------------

----------------------------------------------------------------

.WAV Sound Functions

----------------------------------------------------------------

wavread Load MS-Windows 3.1 .WAV format sound file.

wavwrite Save MS-Windows 3.1 .WAV format sound file.

----------------------------------------------------------------

Character String Functions

------------------------------------------------------------

General

Page 17: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

------------------------------------------------------------

abs Convert string to numeric values.

blanks Create string of blanks.

deblank Remove trailing blanks and null spaces from string.

eval Execute string with MATLAB expression.

findstr Find one string within another.

isstr True for string.

setstr Convert numeric values to string.

str2mat Form text matrix from individual strings.

string About character strings in MATLAB.

strrep String search and replace.

strtok First token in string.

------------------------------------------------------------

-------------------------------------------------

String Comparison

-------------------------------------------------

isletter True for alphabetic character.

lower Convert string to lower case.

strcmp Compare strings.

upper Convert string to upper case.

-------------------------------------------------

---------------------------------------------------------------------

-------

String to Number Conversion

---------------------------------------------------------------------

-------

int2str Convert integer to string.

num2str Convert number to string.

sprintf Convert number to string under format control.

sscanf Convert string to number under format control.

str2num Convert string to number.

---------------------------------------------------------------------

-------

---------------------------------------------------------------------

-------------

Hexadecimal to Number Conversion

---------------------------------------------------------------------

-------------

dec2hex Convert decimal integer to hex string.

hex2dec Convert hex string to decimal integer.

hex2num Convert hex string to IEEE floating-point number.

---------------------------------------------------------------------

-------------

Low-level File I/O Functions

-------------------------------------

File Opening and Closing

-------------------------------------

fclose Close file.

fopen Open file.

-------------------------------------

-------------------------------------------

Unformatted I/O

-------------------------------------------

fread Read binary data from file.

fwrite Write binary data to file.

-------------------------------------------

-------------------------------------------------------------

Page 18: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Formatted I/O

-------------------------------------------------------------

fgetl Read line from file, discard newline character.

fgets Read line from file, keep newline character.

fprintf Write formatted data to file.

fscanf Read formatted data from file.

-------------------------------------------------------------

------------------------------------------------

File Positioning

------------------------------------------------

feof Test for end-of-file.

ferror Inquire file I/O error status.

frewind Rewind file.

fseek Set file position indicator.

ftell Get file position indicator.

------------------------------------------------

----------------------------------------------------

String Conversion

----------------------------------------------------

sprintf Write formatted data to string.

sscanf Read string under format control.

----------------------------------------------------

---------------------------------------------------------------------

---

Specialized File I/O

---------------------------------------------------------------------

---

csvread Read a file of comma separated values.

csvwrite Write a file of comma separated values.

uigetfile Retrieve name of file to open through dialog box.

uiputfile Retrieve name of file to write through dialog box.

wk1read Read a Lotus123 WK1 spreadsheet file.

wk1write Write a Lotus123 WK1 spreadsheet file.

---------------------------------------------------------------------

---

External Interface Library

--------------------------------------

Matrix Access Routines

--------------------------------------

mxCreateFull Allocate Matrices

mxCreateSparse Allocate Matrices

mxCreateString Create string from Matrix.

mxFreeMatrix Free Matrices

mxGetIr Get sparse ir arrays.

mxGetJc Get sparse jc arrays.

mxGetM Get the row dimension of a Matrix.

mxGetN Get column dimension of a Matrix.

mxGetName Get the name of a Matrix.

mxGetNzmax Get the maximum number of sparse nonzero entries.

mxGetPi Get pointers to the real and imaginary parts of a

Matrix.

mxGetPr Get pointers to the real and imaginary parts of a

Matrix.

mxGetScalar Get the (1,1) element of a Matrix.

mxGetString Create string from Matrix and get string Matrix.

mxIsComplex Inquire whether a Matrix is complex.

mxIsDouble Inquire if the Matrix is of type double.

Page 19: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

mxIsFull Inquire sparsity of a Matrix.

mxIsNumeric Inquire if Matrix contains numeric or string data.

mxIsSparse Inquire sparsity of a Matrix.

mxIsString Inquire if Matrix contains numeric or string data.

mxSetIr Set the sparse ir array.

mxSetJc Set the sparse jc array.

mxSetM Set the row dimension of a Matrix.

mxSetN Set the column dimensions of a Matrix.

mxSetName Set the name of a Matrix.

mxSetNzmax Set the maximum number of sparse nonzero entries.

mxSetPi Set pointers to the real and imaginary parts of a

Matrix.

mxSetPr Set pointers to the real and imaginary parts of a

Matrix.

--------------------------------------

---------------------------------

Memory Allocation Routines

---------------------------------

mxCalloc Allocate memory using MATLAB's memory manager.

mxFree Free memory using MATLAB's memory manager.

---------------------------------

-----------------------------------

Fortran and C Conversion Routines

-----------------------------------

mxCopyCharacterToPtr Copy CHARACTER values between Fortran and

pointer arrays.

mxCopyComplex16ToPtr Copy COMPLEX*16 values between Fotran and

pointer arrays.

mxCopyInteger4ToPtr Copy INTEGER*4 values between Fotran and pointer

arrays.

mxCopyPtrToCharacter Copy CHARACTER values between Fotran and pointer

arrays.

mxCopyPtrToComplex16 Copy COMPLEX*16 values between Fortran and

pointer arrays.

mxCopyPtrToInteger4 Copy INTEGER*4 values between Fortran and

pointer arrays.

mxCopyPtrToReal8 Copy REAL*8 values between Fortran and pointer

arrays.

mxCopyReal8ToPtr Copy REAL*8 values between Fortran and pointer

arrays.

-----------------------------------

--------------------------------

MEX-File Routines

--------------------------------

mexAtExit Register a function to be called on shutdown.

mexCallMATLAB Call internal MATLAB functions.

mexErrMsgTxt Issue error message and return to MATLAB.

mexEvalString Execute statement in string.

mexFunction Entry point to a MEX-file.

mexGetFull Easier way to get full Matrices into a workspace.

mexGetMatrix Get Matrices into a MEX-file's caller's workspace.

mexGetMatrixPtr Get the pointer to a Matrix in the caller's

workspace.

mexPrintf Buffered printf routine.

mexPutFull Easier way to put full Matrices into a workspace.

mexPutMatrix Put Matrices into a MEX-file's caller's workspace.

mexSetTrapFlag Control response of mexCallMATLAB to errors.

--------------------------------

-------------------------------

MAT-File Routines

-------------------------------

Page 20: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

matClose Closes MAT-files.

matDeleteMatrix Delete named Matrix from MAT-file.

matGetDir Get directory of Matrices in a MAT-file.

matGetFp Get file pointer to a MAT-file.

matGetFull Easiest way to get full Matrices into MAT-files.

matGetMatrix Get Matrices into MAT-files.

matGetNextMatrix Get next Matrix from MAT-file

matGetString Get string Matrices into MAT-files.

matOpen Open MAT-files.

matPutFull Easiest way to put full Matrices into MAT-files.

matPutMatrix Put Matrices into MAT-files.

matPutString Put string Matrices into MAT-files.

-------------------------------

-------------------------------

Engine Routines

-------------------------------

engClose Kill a MATLAB engine.

engEvalString Execute statement in string.

engGetFull Easier way to get full Matrices into an engine.

engGetMatrix Get Matrices into a MATLAB engine's workspace.

engOpen Start a MATLAB engine.

engOutputBuffer Define output buffer.

engPutFull Easier way to put full Matrices into an engine.

engPutMatrix Put Matrices into a MATLAB engine's workspace.

engSetEvalCallback Enable nonblocking engEvalString calls.

engSetEvalTimeout Set timeout duration for engine routines.

engWinInit Initialize the engine library with the

instance handle of your Windows program.

-------------------------------

--------------------------------------

DDE Routines (Windows Platform Only)

--------------------------------------

ddeadv Set up advisory link between MATLAB and DDE server

application.

ddeexec Send execution string to DDE server application.

ddeinit Initiate DDE conversation between MATLAB and another

application.

ddepoke Send data from MATLAB to DDE server application.

ddereq Request data from DDE server application.

ddeterm Terminate DDE conversation between MATLAB and server

application.

ddeunadv Release an advisory link between MATLAB and DDE server

application.

-----------------------------

The MATLAB Expo and other demonstrations. MATLAB/Introduction.

expo, demo - Start up The MATLAB Expo and display splash screen.

expomap - Open the MATLAB Expo Main Map (avoids Expo splash

screen).

MATLAB/Matrices.

intro - Introduction to MATLAB.

inverter - Demonstrate the inversion of a matrix.

buckydem - Connectivity graph of the Buckminster Fuller

geodesic dome.

sparsity - Demonstrate effect of sparsity orderings.

matmanip - Introduction to matrix manipulation.

delsqdemo - Finite difference Laplacian on various domains.

sepdemo - Separators for a finite element mesh.

airfoil - Display sparse matrix from NASA airfoil.

Page 21: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

MATLAB/Numerics.

funfuns - Demonstrate functions that operate on other

functions.

fitdemo - Nonlinear curve fit with simplex algorithm.

sunspots - The answer is 11.08, what is the question?

e2pi - Which is greater, e^pi or pi^e?

bench - MATLAB Benchmark.

odedemo - Ordinary differential equations.

quaddemo - Adaptive quadrature.

zerodemo - Zerofinding with fzero.

fplotdemo - Plot a function.

eigmovie - Symmetric eigenvalue movie.

rrefmovie - Computation of Reduced Row Echelon Form.

fftdemo - Use of the fast finite Fourier transform.

quake - Loma Prieta Earthquake.

census - Try to predict the US population in the year 2000.

spline2d - Demonstrate GINPUT and SPLINE in two dimensions.

MATLAB/Visualization.

graf2d - Demonstrate XY plots in MATLAB.

graf2d2 - Demonstrate XYZ plots in MATLAB.

grafcplx - Demonstrate complex function plots in MATLAB.

lorenz - Plot the orbit around the Lorenz chaotic attractor.

xpsound - Demonstrate MATLAB V4's sound capability.

vibes - Vibrating L-shaped membrane.

xpklein - Klein bottle demo.

fourier - Graphics demo of Fourier series expansion.

cplxdemo - Maps of functions of a complex variable.

peaks - A sample function of two variables.

membrane - Generate MathWorks's logo.

penny - Several views of the penny data.

earthmap - View Earth's topography.

sqdemo - Superquadrics using UIControls.

imagedemo - Demonstrate MATLAB V4's image capability.

colormenu - Select color map.

MATLAB/Language.

xplang - Introduction to the MATLAB language.

graf3d - Demonstrate Handle Graphics for surface plots.

hndlgraf - Demonstrate Handle Graphics for line plots.

hndlaxis - Demonstrate Handle Graphics for axes.

SIMULINK/Simple Systems.

simintro - A quick introduction to SIMULINK. libintro - A

quick introduction to the SIMULINK Libraries.

simppend - SIMULINK system modeling a simple pendulum.

onecart - SIMULINK system modeling a mass-spring system.

bounce - SIMULINK system modeling a bouncing ball.

vdp - SIMULINK system modeling the Van der Pol equations.

SIMULINK/Complex Systems.

dblcart1 - SIMULINK system modeling a mass-spring system.

dblpend1 - SIMULINK system modeling a double-pendulum system.

dblpend2 - SIMULINK system modeling a double-pendulum system.

penddemo - SIMULINK system modeling an inverted pendulum.

dblcart - SIMULINK system modeling a double-cart system.

thermo - SIMULINK system modeling a thermostat heating a

house.

f14 - SIMULINK system modeling an aircraft in flight.

SIMULINK/Advanced Products.

Page 22: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

xpaccel - Provide information about the SIMULINK Accelerator.

ccodegen - Provide information about the C-Code Generator.

Toolbox/Signal Processing.

filtdem - Signal Processing filter demo.

filtdem2 - Demonstrate filter design techniques.

sigdemo1 - Discrete-time Fourier transform of a signal.

sigdemo2 - Continuous-time Fourier transform of a signal.

phone - Signal processing and the touch-tone phone.

Toolbox/System Identification.

sysiddm - Identify "hairdryer" system characteristics.

iddems - Set up System Identification command line demos.

Toolbox/Optimization.

bandem - Banana function minimization demonstration.

optdems - Set up Optimization command line demos.

Toolbox/Neural Networks.

bckprp12 - Demonstrate backpropagation.

bckprp62 - Demonstrate backpropagation with momentum.

neural - Neural network character recognition.

Toolbox/Control System.

dskdemo - Build controller for a disk read/write head.

ctrldems - Set up Control System command line demos.

Toolbox/Robust Control.

accdm2 - Demo of the 1990 ACC benchmark.

rctdems - Set up Robust Control command line demos.

Toolbox/Mu-Analysis and Synthesis.

xpmu - Description of the Mu-Analysis and Synthesis

process.

mudems - Set up Mu-Analysis and Synthesis command line demos.

Toolbox/Spline.

spapidm2 - Demonstrate spline interpolation.

spldems - Set up Spline command line demos.

Toolbox/Symbolic Math.

xpcalc - Calculus operations.

xpgiv - Givens transformation.

Toolbox/Image Processing.

xpimage - Demonstrate some Image Processing capabilities.

Toolbox/Statistics.

xppolytl - Interactively fit a polynomial to noisy data.

statdems - Set up Statistics command line demos.

Extras/Gallery.

knot - Tube surrounding a three-dimensional knot.

quivdemo - Demonstrate the quiver function.

modes - Plot 12 modes of the L-shaped membrane.

logo - Display the MATLAB L-shaped membrane logo.

klein1 - Construct a Klein bottle.

cruller - Construct cruller.

tori4 - Construct four linked tori.

spharm2 - Construct spherical surface harmonic.

Page 23: Matlab Reference - tsoligas.ee.teiste.grtsoligas.ee.teiste.gr/AppliedMaths/MatlabReference.pdf · Matlab Reference ... Matrices and Matrix Manipulation ... besselj Bessel functions

Extras/Games.

xpbombs - Minesweeper game.

life - Conway's Game of Life.

bblwrap - Bubblewrap.

Extras/Miscellaneous.

truss - Animation of a bending bridge truss.

travel - Traveling salesman problem.

wrldtrv - Great circle flight routes around the globe.

makevase - Generate and plot a surface of revolution.

logospin - Movie of The MathWorks' logo spinning.

crulspin - Spinning cruller movie.

xpquad - Superquadrics plotting demonstration.

spinner - Colorful lines spinning through space.

Extras/Contact Info.

contact1 - How to reach The MathWorks, Inc.

contact2 - How to reach The MathWorks, Inc. by email.

contact3 - How to reach international agents for The MathWorks,

Inc.

agents - International distributors' locations and contact

information.

General Expo/Helper functions.

expomenu - Initializes Expo menubar.

cmdlnwin - An Expo gateway routine for playing command line

demos.

existtb - Tests for the availability of individual toolboxes

by name.

helpfun - Utility function for displaying help text

conveniently.

hlpmaker - An Expo help-making utility.

pltmat - Display a matrix in a figure window.

MATLAB/Helper functions.

bucky - The graph of the Buckminster Fuller geodesic dome.

SIMULINK/Helper functions.

animinit - Initializes a figure for SIMULINK animations.

crtanim1 - S-function for animating the motion of a mass-spring

system.

crtanim2 - S-function for animating the motion of a mass-spring

system.

simcad - The SIMULINK system caddy.