Top 10 Matlab Commands for Linear Algebra Students

  1. basic input: "A = [ 1 2 3; -1 2 3; 2 4 5 ]" inputs a 3x3 matrix by rows; variants
    "b = [ -1 2 1]' " or "b = [ -1; 2; 1]" to input a column vector b, and
    "C = [ A b ]" to produce a matrix C containing A augmented with b.
  2. rref: "rref(A)" reduces A to reduced echelon form; see also "rrefmovie(A)".
  3. basic arithmetic: "A*B", "A+B", "A\b" to multiply and add matrices, solve Ax = b.
  4. rand: "rand(6,4)" produces a random 6x4 matrix.
  5. det: "det(A)" computes the determinant of a square matrix A.
  6. inv: "inv(A)" tries to compute the inverse of a square matrix A.
  7. eig: "eig(A)" computes eigenvalues(vectors) for square A; try "help eig" for more info.
  8. format: "format compact" reduces output spaces; also try "format long", "format rat", "help format".
  9. help: "help command" gives information about "command", e.g. "help rref".
  10. lookfor: "lookfor keyword" tries to find commands relevant to "keyword"; e.g. "lookfor null".