% Special arrays eye(3) % a 3x3 identity array eye(3,5) % a 3x5 array with ones on the "diagonal" ones(4) % 4x4 array of 1's ones(2,3)*5 % 2x3 array of 5's zeros(3) % 3x3 array of zeroes rand(3,2) % 3x2 array of random numbers between 0 and 1 d = 1:4 diag(d) % Make a diagonal array using the elements of d diag(d,-1) % same but move the elements of d down by 1 row each repmat(2.5,3,2) % "rep"licate "mat"rix, fastest way (in term of cpu time)

Gus Hart 2005-01-28