Input/output commands
disp Displays contents of an array or string. 31
format Controls screen display format. 14, 31
fprintf Performs formatted writes to screen or le. 549
input Displays prompts and waits for input. 31, 171
menu Displays a menu of choices. 31
; Suppresses screen printing. 12
Array functions
cat Concatenates arrays. 64
nd Finds indices of nonzero elements. 60, 161
length Computes number of elements. 19
linspace Creates regularly spaced vector. 60
logspace Creates logarithmically spaced vector. 60
max Returns largest element. 60
min Returns smallest element. 60
size Computes array size. 60
sort Sorts each column. 60, 296
sum Sums each column. 60
Special matrices
eye Creates an identity matrix. 83
ones Creates an array of 1s. 83
zeros Creates an array of 0 s. 83
Complex functions
abs(x) Absolute value; 114
angle(x) Angle of a complex number x. 114
conj(x) Complex conjugate of x. 114
imag(x) Imaginary part of a complex number x. 114
real(x) Real part of a complex number x. 114
Complex functions
abs(x) Absolute value; 114
angle(x) Angle of a complex number x. 114
conj(x) Complex conjugate of x. 114
imag(x) Imaginary part of a complex number x. 114
real(x) Real part of a complex number x. 114
Numeric functions
ceil Rounds to the nearest integer toward 114
fix Rounds to the nearest integer toward zero. 114
floor Rounds to the nearest integer toward # 114
round Rounds toward the nearest integer. 114
sign Signum function. 114
Trigonometric functions
acos(x) Inverse cosine; arccos x " cos#1x. 21, 118
acot(x) Inverse cotangent; arccot x " cot#1x. 118
acsc(x) Inverse cosecant; arccsc x " csc#1x. 118
asec(x) Inverse secant; arcsec x " sec#1x. 118
asin(x) Inverse sine; arcsin x " sin#1x. 21, 118
atan(x) Inverse tangent; arctan x " tan#1x. 21, 118
atan2(y,x) Four-quadrant inverse tangent. 118
cos(x) Cosine; cos x. 21, 118
cot(x) Cotangent; cot x. 118
csc(x) Cosecant; csc x. 118
sec(x) Secant; sec x. 118
sin(x) Sine; sin x. 118
tan(x) Tangent; tan x. 118
Hyperbolic functions
acosh(x) Inverse hyperbolic cosine; cosh#1x. 119
acoth(x) Inverse hyperbolic cotangent; coth#1x. 119
acsch(x) Inverse hyperbolic cosecant; csch#1x. 119
asech(x) Inverse hyperbolic secant; sech#1x. 119
asinh(x) Inverse hyperbolic sine; sinh#1x. 119
atanh(x) Inverse hyperbolic tangent; tanh#1x. 119
cosh(x) Hyperbolic cosine; cosh x. 119
coth(x) Hyperbolic cotangent; cosh x /sinh x. 119
csch(x) Hyperbolic cosecant; 1$sinh x. 119
sech(x) Hyperbolic secant; 1$cosh x. 119
sinh(x) Hyperbolic sine; sinh x. 119
tanh(x) Hyperbolic tangent; sinh x / cosh x. 119
Polynomial functions
Logical functions
any True if any elements are nonzero. 161
all True if all elements are nonzero. 161
nd Finds indices of nonzero elements. 161
nite True if elements are nite. 161
ischar True if elements are a character array. 161
isinf True if elements are in nite. 161
isempty True if matrix is empty. 161
isnan True if elements are unde ned. 161
isreal True if all elements are real. 161
isnumeric True if elements have numeric values. 161
logical Converts a numeric array to a logical array. 161
xor Exclusive OR. 161
Program ow control
break Terminates execution of a loop. 176
case Provides alternate execution paths within switch structure. 188
continue Passes control to the next iteration of a for or while loop. 276
else Delineates alternate block of statements. 166
elseif Conditionally executes statements. 168
end Terminates for, while, and if statements. 166
for Repeats statements a speci c number of times. 172
if Executes statements conditionally. 165
otherwise Provides optional control within a switch structure. 188
switch Directs program execution by comparing input with 188
case expressions.
while Repeats statements an inde nite number of times. 183
Histogram functions
bar Creates a bar chart. 235, 295
hist Aggregates the data into bins. 300
Statistical functions
cumsum Computes the cumulative sum across a row. 303
erf Computes the error function erf(x). 305
mean Calculates the mean. 296
median Calculates the median. 296
std Calculates the standard deviation. 304
Polynomial functions
poly Computes the coef cients of a polynomial from its roots. 86
polyfit Fits a polynomial to data. 273
polyval Evaluates a polynomial and generates error estimates. 273
roots Computes the roots of a polynomial from its coef cients. 86
Interpolation functions
interp1 Linear and cubic spline interpolation of a function of 320
one variable.
interp2 Linear interpolation of a function of two variables. 317
spline Cubic spline interpolation. 320
unmkpp Computes the coef cients of cubic spline polynomials. 320