[UP]


Manual Reference Pages  - mat (1)

NAME

mat(1f) - interpret matrix expressions using a shell-like interface

CONTENTS

Synopsis
Description
Options
Author
Examples

SYNOPSIS

mat [ --help| --version]

DESCRIPTION

mat(1) is an interactive computer program that serves as a convenient "laboratory" for computations involving matrices. It provides easy access to matrix software developed by the LINPACK and EISPACK projects. The capabilities range from standard tasks such as solving simultaneous linear equations and inverting matrices, through symmetric and nonsymmetric eigenvalue problems, to fairly sophisticated matrix tools such as the singular value decomposition.

OPTIONS

--help display this help and exit
--version
  output version information and exit

AUTHOR

This is heavily based on a program from the Department of Computer Science, University of New Mexico, by Cleve Moler.

EXAMPLES

Sample commands

   # Example 1: introductory usage:
   mat
   a=<1 2 3;5 4 6;7 8 9>
   b=<5;6;7>
   a*b
   b*a
   det(a)
   quit

An explanation of Example 1:

   // For this session the <> character is the MATLAB prompt.
    <> a=<1 2 3;5 4 6;7 8 9>            <---  you enter this

A = <--- MATLAB response

1. 2. 3. 5. 4. 6. 7. 8. 9.

<> b=<5;6;7> <--- you enter this

B = <--- MATLAB response

5. 6. 7.

<> a*b <--- you enter "multiply a and b"

ANS = <--- MATLAB response

38. 91.

146.

<> b*a <---you enter "multiply b and a"
/--ERROR
  <--- MATLAB response

    INCOMPATIBLE FOR MULTIPLICATION

<> det(a)
  <--- Take the determinant of a
ANS = <---MATLAB response
       18.

<> quit
  <--- you quit MATLAB
total flops
  34

    ADIOS

// ----------------------------------------------------------------------------

Example 2: Simple looping and conditionals are also available

   mat
   //Eigenvalue sensitivity example. See section 8 of the Users’ Guide.
   B = <3 0 7; 0 2 0; 0 0 1>
   L = <1 0 0; 2 1 0; -3 4 1>,  M = L\L’
   A = M*B/M
   A = round(A)
   <X,D> = eig(A)
   long,  diag(D),  short
   cond(X)
   X = X/diag(X(3,:)),  cond(X)
   Y = inv(X’),  Y’*A*X
   for j = 1:3, c(j) = norm(Y(:,j))*norm(X(:,j));

    C

E = -1.e-6*Y(:,1)*X(:,1)’
eig(A + .4*E),
  eig(A + .5*E)
r = .4; s = .5; while s-r > 1.e-14, t = (r+s)/2; d = eig(A+t*E); ... if imag(d(1))=0, r = t; else, s = t;
long, t = r
A+t*e, eig(A+t*E)
<X,D> = eig(A+t*E);
  X = X/diag(X(3,:))
short, cond(X) // ----------------------------------------------------------------------------
Use the HELP command and the DOC command for further information. For example:

      mat
      <>doc(’mat.txt’)
      <>quit

will place a User manual in the file "mat.txt".


mat (1) March 11, 2021
Generated by manServer 1.08 from 9d9cc91a-4210-45d1-83e6-906cb69e911e using man macros.