Upgrading from MATLAB 4 to MATLAB 5.0     Search    Help Desk 

New and Enhanced Language Functions

MATLAB 5.0 provided a large number of new language functions as well as enhancements to existing functions.

Table 1-9: New Elementary and Specialized Math Functions
Function
Description
airy
Airy functions.
besselh
Bessel functions of the third kind (Hankel).
condeig
Condition number with respect to eigenvalues.
condest
1-norm matrix condition estimate.
dblquad
Numerical double integration
mod
Modulus (signed remainder after division).
normest
2-norm estimate.
Table 1-10: New Time and Date Functions
Function
Description
calendar
Calendar.
datenum
Serial date number.
datestr
Create date string.
datetick
Date formatted tick labels.
datevec
Date components.
eomday
End of month.
now
Current date and time.
weekday
Day of the week.
Table 1-11: New Ordinary Differential Equation Functions
Function
Description
ode45, ode23, ode113, ode23s, ode15s
Solve differential equations, low- and high- order methods.
odefile
Define a differential equation problem for ODE solvers.
odeget
Extract options from an argument created with odeset.
odeset
Create and edit input arguments for ODE solvers.
Table 1-12: New Matrix Functions
Function
Description
cholinc
Incomplete Cholesky factorization.
gallery
More than 50 new test matrices.
luinc
Incomplete LU factorization.
repmat
Replicate and tile an array.
sprand
Random uniformly distributed sparse matrices.
Table 1-13: New Methods for Sparse Matrices  
Method
Description
bicg
BiConjugate Gradients method.
bicgstab
BiConjugate Gradients Stabilized method.
cgs
Conjugate Gradients Squared method.
eigs
Find a few eigenvalues and eigenvectors.
gmres
Generalized Minimum Residual method.
pcg
Preconditioned Conjugate Gradients method.
qmr
Quasi-Minimal Residual method.
svds
A few singular values.

Subscripting and Assignment Enhancements

In MATLAB 5.0, you can:

A statement like A(ones([m,n])) now always returns an m-by-n array in which each element is A(1). In previous versions, the statement returned different results depending on whether A was or was not an m-by-n matrix.

In previous releases, expressions like A(2:3,4:5) = 5 resulted in an error. MATLAB 5.0 automatically "expands" the 5 to be the right size (that is, 5*ones(2,2)).

Integer Bit Manipulation Functions

The ops directory contains commands that permit bit-level operations on integers. Operations include setting and unsetting, complementing, shifting, and logical AND, OR, and XOR.

Table 1-14: New Bitwise Functions  
Function
Description
bitand
Bitwise AND.
bitcmp
Complement bits.
bitget
Get bit.
bitmax
Maximum floating-point integer.
bitor
Bitwise OR.
bitset
Set bit.
bitshift
Bitwise shift.
bitxor
Bitwise XOR.

Dimension Specification for Data Analysis Functions

MATLAB's basic data analysis functions now enable you to supply a second input argument. This argument specifies the dimension along which the function operates. For example, create an array A:

To sum along the first dimension of A, incrementing the row index, specify 1 for the dimension of operation:

To sum along the second dimension, incrementing the column index, specify 2 for the dimension:

Other functions that accept the dimension specifier include prod, cumprod, and cumsum.

Wildcards in Utility Commands

The asterisk (*) can be used as a wildcard in the clear and whos commands. This allows you, for example, to clear only variables beginning with a given character or characters, as in

Empty Arrays

Earlier versions of MATLAB allowed for only one empty matrix, the 0-by-0 matrix denoted by []. MATLAB 5.0 provided for matrices and arrays in which some, but not all, of the dimensions are zero. For example, 1-by-0, 10-by-0-by-20, and [3 4 0 5 2] are all possible array sizes.

The two-character sequence [] continues to denote the 0-by-0 matrix. Empty arrays of other sizes can be created with the functions zeros, ones, rand, or eye. To create a 0-by-5 matrix, for example, use

The basic model for empty matrices is that any operation that is defined for m-by-n matrices, and that produces a result with a dimension that is some function of m and n, should still be allowed when m or n is zero. The size of the result should be that same function, evaluated at zero.

For example, horizontal concatenation

requires that A and B have the same number of rows. So if A is m-by-n and B is m-by-p, then C is m-by-(n+p). This is still true if m or n or p is zero.

Many operations in MATLAB produce row vectors or column vectors. It is now possible for the result to be the empty row vector

or the empty column vector

Some MATLAB functions, like sum and max, are reductions. For matrix arguments, these functions produce vector results; for vector arguments they produce scalar results. Backwards compatibility issues arise for the argument [], which in MATLAB 4 played the role of both the empty matrix and the empty vector. In MATLAB 5.0, empty inputs with these functions produce these results:



[ Previous | Help Desk | Next ]