OSNOVNI UKAZI PROGRAMSKEGA JEZIKA MATLAB
Matlab ima zelo dobro dokumentacijo, ki je v celoti dostopna na Webu. Lahko jo tudi prenesete na svoj racunalnik v obliki PDF datotek.
Osnovne skupine in operacije v Matlabu so:
Arithmetic operators.
plus - Plus +
uplus - Unary plus +
minus - Minus -
uminus - Unary minus -
mtimes - Matrix multiply *
times - Array multiply .*
mpower - Matrix power ^
power - Array power .^
mldivide - Backslash or left matrix divide \
mrdivide - Slash or right matrix divide /
ldivide - Left array divide .\
rdivide - Right array divide ./
Relational operators.
eq - Equal ==
ne - Not equal ~=
lt - Less than <
gt - Greater than >
le - Less than or equal <=
ge - Greater than or equal >=
Control flow.
if - Conditionally execute statements.
else - IF statement condition.
elseif - IF statement condition.
end - Terminate scope of FOR, WHILE, SWITCH, TRY and IF statements.
for - Repeat statements a specific number of times.
while - Repeat statements an indefinite number of times.
break - Terminate execution of WHILE or FOR loop.
Elementary matrices.
zeros - Zeros array.
ones - Ones array.
eye - Identity matrix.
repmat - Replicate and tile array.
rand - Uniformly distributed random numbers.
randn - Normally distributed random numbers.
linspace - Linearly spaced vector.
logspace - Logarithmically spaced vector.
meshgrid - X and Y arrays for 3-D plots.
: - Regularly spaced vector and index into matrix.
Basic array information.
size - Size of matrix.
length - Length of vector.
Trigonometric.
sin - Sine.
sinh - Hyperbolic sine.
asin - Inverse sine.
asinh - Inverse hyperbolic sine.
cos - Cosine.
cosh - Hyperbolic cosine.
acos - Inverse cosine.
acosh - Inverse hyperbolic cosine.
tan - Tangent.
tanh - Hyperbolic tangent.
atan - Inverse tangent.
atan2 - Four quadrant inverse tangent.
atanh - Inverse hyperbolic tangent.
acot - Inverse cotangent.
acoth - Inverse hyperbolic cotangent.
Exponential.
exp - Exponential.
log - Natural logarithm.
log10 - Common (base 10) logarithm.
log2 - Base 2 logarithm and dissect floating point number.
pow2 - Base 2 power and scale floating point number.
sqrt - Square root.
nextpow2 - Next higher power of 2.
Complex.
abs - Absolute value.
angle - Phase angle.
complex - Construct complex data from real and imaginary parts.
conj - Complex conjugate.
imag - Complex imaginary part.
real - Complex real part.
Rounding and remainder.
fix - Round towards zero.
floor - Round towards minus infinity.
ceil - Round towards plus infinity.
round - Round towards nearest integer.
Two dimensional graphs.
Elementary X-Y graphs.
plot - Linear plot.
loglog - Log-log scale plot.
semilogx - Semi-log scale plot.
semilogy - Semi-log scale plot.
polar - Polar coordinate plot.
plotyy - Graphs with y tick labels on the left and right.
Axis control.
axis - Control axis scaling and appearance.
zoom - Zoom in and out on a 2-D plot.
grid - Grid lines.
box - Axis box.
hold - Hold current graph.
axes - Create axes in arbitrary positions.
subplot - Create axes in tiled positions.
Graph annotation.
plotedit - Tools for editing and annotating plots.
legend - Graph legend.
title - Graph title.
xlabel - X-axis label.
ylabel - Y-axis label.
texlabel - Produces TeX format from a character string
text - Text annotation.
gtext - Place text with mouse.
Elementary 3-D plots.
plot3 - Plot lines and points in 3-D space.
mesh - 3-D mesh surface.
surf - 3-D colored surface.
fill3 - Filled 3-D polygons.
Contour and 2-1/2 D graphs.
contour - Contour plot.
contourf - Filled contour plot.
contour3 - 3-D Contour plot.
clabel - Contour plot elevation labels.