Convenient matrix building functions are

For example,eye(10) identity matrix zeros(10) matrix of zeros ones(10) matrix of ones diag(A) returns diagonal M.E. as vector triu(A) upper triangular part of a matrix tril(A) lower triangular part of a matrix rand(10) randomly generated matrix hilb(5) Hilbert matrix magic(5) magic square toeplitz see help toeplitz

If `x` is a vector, `diag(x)` is the diagonal matrix with
`x` down the
diagonal; if `A` is a square matrix, then `diag(A)` is a
vector consisting
of the diagonal of `A` . What is `diag(diag(A))`? Try it.

Matrices can be built from blocks. For example, if A is a 3-by-3 matrix, then

will build a certain 5-by-5 matrix. Try it.B = [A, zeros(3,2); zeros(2,3), eye(2)]

Wed Mar 13 19:15:55 MET 1996