home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / m / matlab / !Matlab / HLP < prev    next >
Text File  |  1994-03-24  |  31KB  |  826 lines

  1.  Appendix.  The HELP document
  2.  
  3. NEWS  MATLAB NEWS dated 3/21/82.
  4.  
  5.  Normalization of some eigenvectors associated with multiple
  6.  eigenvalues has been altered to reduce overflow.
  7.  
  8.  New features added since the November 1980 printing of the
  9.  Users' Guide include six element-by-element operations
  10.  
  11.              .*  ./  .\  .*.  ./.  .\.,  and
  12.  
  13.     DIARY, EDIT, KRON, MACRO, PLOT, RAT, TRIL, TRIU.  
  14.  
  15.  Some additional capabilities have been added to 
  16.  
  17.        EXIT, RANDOM, RCOND, SIZE and SVD.
  18.  
  19. INTRO  Welcome to MATLAB.
  20.  
  21.  Here are a few sample statements:
  22.  
  23.        A = <1 2; 3 4>
  24.        b = <5 6>'
  25.        x = A\b
  26.        <V,D> = eig(A)
  27.        norm(A-V*D/V)
  28.        help \
  29.        help eig exec('demo',7)
  30.  
  31.  For more information, see the MATLAB Users' Guide.
  32.  
  33. HELP  HELP gives assistance.
  34.   HELP HELP obviously prints this message. 
  35.   To see all the HELP messages, which include all the
  36.   functions and operators available in this Archimedes
  37.   version of MATLAB, list the file HLP.
  38.  
  39. <   < > Brackets used in forming vectors and matrices.
  40.     [ ] can also be used for this purpose.
  41.  
  42.  <6.9  9.64  SQRT(-1)> is a vector with three elements
  43.  separated by blanks.  <6.9,9.64,sqrt(-1)> is the same
  44.  thing.  <1+I  2-I  3> and <1 +I  2  -I  3> are not the
  45.  same; the first has three elements, the second has five. 
  46.  <11 12 13; 21 22 23> is a 2 by 3 matrix - the semicolon
  47.  ends the first row.
  48.  
  49.  Vectors and matrices can be used inside < > brackets.
  50.  <A B; C> is allowed if the number of rows of A equals the
  51.  number of rows of B and the number of columns of A plus the
  52.  number of columns of B equals the number of columns of C. 
  53.  This rule generalizes in a hopefully obvious way to allow
  54.  fairly complicated constructions.
  55.  
  56.  A = < >  stores an empty matrix in A, thereby removing it
  57.  from the list of current variables.
  58.  
  59.  For the use of < and > on the left of the  =  in multiple
  60.  assignment statements, see LU, EIG, SVD and so on.
  61.  
  62.  In WHILE and IF clauses,
  63.    <> means less than or greater than, i.e. not equal,
  64.    < means less than,
  65.    > means greater than,
  66.    <= means less than or equal,
  67.    >= means greater than or equal.
  68.  
  69.  For the use of > and < to delineate macros, see MACRO.
  70.  
  71. >   See <.  Also see MACRO.
  72.  
  73. (   ( ) used to indicate precedence in arithmetic
  74.  expressions in the usual way, to enclose arguments of
  75.  functions in the usual way, and to enclose sub-scripts
  76.  of vectors and matrices in a manner somewhat more general
  77.  than the usual way.  If X and V are vectors, then X(V) is
  78.  <X(V(1)),X(V(2)), ... ,X(V(N)>.  The components of V are
  79.  rounded to nearest integers and used as subscripts.  An
  80.  error occurs if any such subscript is less than 1 or
  81.  greater than the dimension of X.
  82.  
  83.  Some examples:
  84.  
  85.    X(3) is the third element of X.
  86.    X(<1 2 3>) is the first three elements of X,so is 
  87.    X(<SQRT(2),SQRT(3),4*ATAN(1)>).
  88.    If X has N components, X(N:-1:1) reverses them.
  89.  
  90.  The same indirect subscripting is used in matrices: if V
  91.  has M components and W has N components, then A(V,W) is
  92.  the M by N matrix formed from the elements of A whose
  93.  subscripts are the elements of V and W.  For example,
  94.  A(<1,5>,:) = A(<5,1>,:) interchanges rows 1 and 5 of A.
  95.  
  96. )   See (.
  97.  
  98. =   Used in assignment statements and to mean equality in
  99.  WHILE and IF clauses.
  100.  
  101. .   Decimal point. 314/100, 3.14 and .314E1 are all the same.
  102.  
  103.  Element-by-element multiplicative operations are obtained
  104.  using .* , ./ , or .\ .  For example, C = A./B is the
  105.  matrix with elements c(i,j)=a(i,j)/b(i,j).
  106.  
  107.  Kronecker tensor products and quotients are obtained with
  108.  .*. , ./. and .\.  See KRON.
  109.  
  110.  Two or more points at the end of the line indicate
  111.  continuation.  The total line length limit is 1024
  112.  characters.
  113.  
  114. ,   Used to separate matrix subscripts and function
  115.  arguments.  Used at the end of FOR, WHILE and IF clauses. 
  116.  Used to separate statements in multi-statement lines.  In
  117.  this situation, it may be replaced by semicolon to suppress
  118.  printing.
  119.  
  120. ;   Used inside brackets to end rows.  Used after an
  121.  expression or statement to suppress printing.  See SEMI.
  122.  
  123. \   (backslash)  Matrix left division.  A\B is roughly the
  124.  same as INV(A)*B, except it is computed in a  different
  125.  way.  If A is an N by N matrix and B is a column vector
  126.  with N components, or a matrix with several such columns,
  127.  then X = A\B is the solution to the equation A*X = B
  128.  computed by Gaussian elimination.  A warning message is
  129.  printed if A is badly scaled or nearly singular.  A\EYE
  130.  produces the inverse of A.
  131.  
  132.  If A is an M by N matrix with M < or > N, and B is a column
  133.  vector with M components, or a matrix with several such
  134.  columns, then X = A\B is the solution in the least squares
  135.  sense to the under- or over-determined system of equations
  136.  A*X = B.  The effective rank, K, of A is determined from
  137.  the QR decomposition with pivoting.  A solution X is
  138.  computed which has at most K non-zero components per
  139.  column.  If K < N this will usually not be the same
  140.  solution as PINV(A)*B.  A\EYE produces a generalized
  141.  inverse of A.
  142.  
  143.  If A and B have the same dimensions, then A.\B has elements
  144.  a(i,j)\b(i,j).  See also KRON.
  145.  
  146. [Also, see EDIT.]
  147.  
  148. /   (slash)  Matrix right division.  B/A is roughly the
  149.  same as B*INV(A).  More precisely, B/A = (A'\B')'.
  150.  See \ (backslash).
  151.  
  152.  IF A and B have the same dimensions, then A./ B has
  153.  elements a(i,j)/b(i,j).  See also KRON.
  154.  
  155.  Two or more slashes together on a line indicate a logical
  156.  end of line.  Any following text is ignored.
  157.  
  158. '   Transpose.  X' is the complex conjugate transpose of X.
  159.     Quote.  'ANY TEXT' is a vector whose components are the
  160.  MATLAB internal codes for the characters.  A quote within
  161.  the text is indicated by two quotes.
  162.  
  163.  See DISP and FILE.
  164.  
  165. +   Addition.  X + Y.  X and Y must have the same
  166.  dimensions.
  167.  
  168. -   Subtraction.  X - Y.  X and Y must have the same
  169.  dimensions.
  170.  
  171. *   Matrix multiplication.  X * Y.  Any scalar (1 by 1
  172.  matrix) may multiply anything.  Otherwise, the number of
  173.  columns of X must equal the number of rows of Y.
  174.  
  175.  Element-by-element multiplication is obtained with X.*Y.
  176.  
  177.  The Kronecker tensor product is denoted by X.*.Y .
  178.  
  179.  Powers.  X**p is X to the power p; p must be a scalar.
  180.  For a matrix X, see FUN.  N.B. Later versions of MATLAB
  181.  use X^p for X to the power p; this is not recognised and
  182.  produces an error in this version.
  183.  
  184. :   Colon.  Used in subscripts, FOR iterations, and
  185.  possibly elsewhere.
  186.  
  187.    J:K is the same as <J,J+1, ... ,K>.
  188.    J:K is empty if J > K.
  189.    J:I:K is the same as <J,J+I,J+2I, ... ,K>.
  190.    J:I:K is empty if I > 0 and J > K,
  191.          or if I < 0 and J < K.
  192.  
  193.  The colon notation can be used to pick out selected rows,
  194.  columns and elements of vectors and matrices.
  195.  
  196.   A(:) is all the elements of A, regarded as a single column.
  197.   A(:,J) is the J-th column of A.
  198.   A(J:K) is  A(J), A(J+1), ... , A(K).
  199.   A(:,J:K) is A(:,J), A(:,J+1), ... ,A(:,K), and so on.
  200.  
  201.  For the use of the colon in the FOR statement, see FOR.
  202.  
  203. ABS  ABS(X) is the absolute value, or complex modulus, of
  204.  the elements of X.
  205.  
  206. ANS  Variable created automatically when expressions are
  207.  not assigned to anything else.
  208.  
  209. ATAN  ATAN(X) is the arctangent of X.  See FUN.
  210.  
  211. BASE  BASE(X,B) is a vector containing the base B
  212.  representation of X.
  213.  This is often used in conjunction with DISPLAY.
  214.  DISPLAY(X,B) is the same as DISPLAY(BASE(X,B)).
  215.  For example, DISP(4*ATAN(1),16) prints the hexadecimal
  216.  representation of pi.
  217.  
  218. CHAR  CHAR(K) requests an input line containing a single
  219.  character to replace MATLAB character number K in the
  220.  following table.  For example, CHAR(45) replaces backslash. 
  221.  CHAR(-K) replaces the alternate character number K.
  222.  
  223.             K character alternate  name
  224.  
  225.        0 -  9   0 - 9     0 - 9   digits
  226.       10 - 35   A - Z     a - z   letters
  227.            36   blank
  228.            37     (         (     lparen
  229.            38     )         )     rparen
  230.            39     ;         ;     semi
  231.            40     :         |     colon
  232.            41     +         +     plus
  233.            42     -         -     minus
  234.            43     *         *     star
  235.            44     /         /     slash
  236.            45     \         $     backslash
  237.            46     =