home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Education
/
collectionofeducationcarat1997.iso
/
SCIENCE
/
MATLAB.ZIP
/
HELP
< prev
next >
Wrap
Text File
|
1986-02-06
|
34KB
|
757 lines
HELP is available
NEWS MATLAB NEWS dated 9/15/83.
HELP is now a lot faster.
INTRO Welcome to MATLAB.
Here are a few sample statements:
A = <1 2; 3 4>
b = <5 6>'
x = A\b
<V,D> = eig(A), norm(A-V*D/V)
help \ , help eig
exec('demo',7)
For more information, see the MATLAB Users' Guide which is
contained in file ... or may be obtained from ... .
< < > Brackets used in forming vectors and matrices.
<6.9 9.64 SQRT(-1)> is a vector with three elements
separated by blanks. <6.9, 9.64, sqrt(-1)> is the same
thing. <1+I 2-I 3> and <1 +I 2 -I 3> are not the same.
The first has three elements, the second has five.
<11 12 13; 21 22 23> is a 2 by 3 matrix . The semicolon
ends the first row.
Vectors and matrices can be used inside < > brackets.
<A B; C> is allowed if the number of rows of A equals
the number of rows of B and the number of columns of A
plus the number of columns of B equals the number of
columns of C . This rule generalizes in a hopefully
obvious way to allow fairly complicated constructions.
A = < > stores an empty matrix in A , thereby removing it
from the list of current variables.
For the use of < and > on the left of the = in multiple
assignment statements, see LU, EIG, SVD and so on.
In WHILE and IF clauses, <> means less than or greater
than, i.e. not equal, < means less than, > means greater
than, <= means less than or equal, >= means greater than or
equal.
For the use of > and < to delineate macros, see MACRO.
> See < . Also see MACRO.
( ( ) Used to indicate precedence in arithmetic expressions
in the usual way. Used to enclose arguments of functions
in the usual way. Used to enclose subscripts of vectors
and matrices in a manner somewhat more general than the
usual way. If X and V are vectors, then X(V) is
<X(V(1)), X(V(2)), ..., X(V(N))> . The components of V
are rounded to nearest integers and used as subscripts. An
error occurs if any such subscript is less than 1 or
greater than the dimension of X . Some examples:
X(3) is the third element of X .
X(<1 2 3>) is the first three elements of X . So is
X(<SQRT(2), SQRT(3), 4*ATAN(1)>) .
If X has N components, X(N:-1:1) reverses them.
The same indirect subscripting is used in matrices. If V
has M components and W has N components, then A(V,W)
is the M by N matrix formed from the elements of A whose
subscripts are the elements of V and W . For example...
A(<1,5>,:) = A(<5,1>,:) interchanges rows 1 and 5 of A .
) See ( .
= Used in assignment statements and to mean equality in WHILE
and IF clauses.
. Decimal point. 314/100, 3.14 and .314E1 are all the
same.
Element-by-element multiplicative operations are obtained
using .* , ./ , or .\ . For example, C = A ./ B is the
matrix with elements c(i,j) = a(i,j)/b(i,j) .
Kronecker tensor products and quotients are obtained with
.*. , ./. and .\. . See KRON.
Two or more points at the end of the line indicate
continuation. The total line length limit is 1024
characters.
, Used to separate matrix subscripts and function arguments.
Used at the end of FOR, WHILE and IF clauses. Used to
separate statements in multi-statement lines. In this
situation, it may be replaced by semicolon to suppress
printing.
; Used inside brackets to end rows.
Used after an expression or statement to suppress printing.
See SEMI.
\ Backslash or matrix left division. A\B is roughly the
same as INV(A)*B , except it is computed in a different
way. If A is an N by N matrix and B is a column vector
with N components, or a matrix with several such columns,
then X = A\B is the solution to the equation A*X = B
computed by Gaussian elimination. A warning message is
printed if A is badly scaled or nearly singular.
A\EYE produces the inverse of A .
If A is an M by N matrix with M < or > N and B is a
column vector with M components, or a matrix with several
such columns, then X = A\B is the solution in the least
squares sense to the under- or overdetermined system of
equations A*X = B . The effective rank, K, of A is
determined from the QR decomposition with pivoting. A
solution X is computed which has at most K nonzero
components per column. If K < N this will usually not be
the same solution as PINV(A)*B .
A\EYE produces a generalized inverse of A .
If A and B have the same dimensions, then A .\ B has
elements a(i,j)\b(i,j) .
Also, see EDIT.
/ Slash or matrix right division. B/A is roughly the same
as B*INV(A) . More precisely, B/A = (A'\B')' . See \ .
IF A and B have the same dimensions, then A ./ B has
elements a(i,j)/b(i,j) .
Two or more slashes together on a line indicate a logical
end of line. Any following text is ignored.
' Transpose. X' is the complex conjugate transpose of X .
Quote. 'ANY TEXT' is a vector whose components are the
MATLAB internal codes for the characters. A quote within
the text is indicated by two quotes. See DISP and FILE .
+ Addition. X + Y . X and Y must have the same dimensions.
- Subtraction. X - Y . X and Y must have the same
dimensions.
* Matrix multiplication, X*Y . Any scalar (1 by 1 matrix)
may multiply anything. Otherwise, the number of columns of
X must equal the number of rows of Y .
Element-by-element multiplication is obtained with X .* Y .
The Kronecker tensor product is denoted by X .*. Y .
Powers. X**p is X to the p power. p must be a
scalar. If X is a matrix, see FUN .
: Colon. Used in subscripts, FOR iterations and possibly
elsewhere.
J:K is the same as <J, J+1, ..., K>
J:K is empty if J > K .
J:I:K is the same as <J, J+I, J+2I, ..., K>
J:I:K is empty if I > 0 and J > K or if I < 0 and J < K .
The colon notation can be used to pick out selected rows,
columns and elements of vectors and matrices.
A(:) is all the elements of A, regarded as a single
column.
A(:,J) is the J-th column of A
A(J:K) is A(J),A(J+1),...,A(K)
A(:,J:K) is A(:,J),A(:,J+1),...,A(:,K) and so on.
For the use of the colon in the FOR statement, See FOR .
ABS ABS(X) is the absolute value, or complex modulus, of the
elements of X .
ANS Variable created automatically when expressions are not
assigned to anything else.
ATAN ATAN(X) is the arctangent of X . See FUN .
BASE BASE(X,B) is a vector containing the base B representation
of X . This is often used in conjunction with DISPLAY.
DISPLAY(X,B) is the same as DISPLAY(BASE(X,B)). For
example, DISP(4*ATAN(1),16) prints the hexadecimal
representation of pi.
CHAR CHAR(K) requests an input line containing a single
character to replace MATLAB character number K in the
following table. For example, CHAR(45) replaces backslash.
CHAR(-K) replaces the alternate character number K.
K character alternate name
0 - 9 0 - 9 0 - 9 digits
10 - 35 A - Z a - z letters
36 blank
37 ( ( lparen