diag:

Syntax:	diag ( A )
	diag ( A , K )

Description:

	If the 1st argument is a 1xN matrix construct a diagonal
	matrix from the input . Optionally if K (scalar) is specified
	then create a matrix with the vector as the Kth diagonal.

	If the 1st argument is a MxN matrix, construct a 1xN matrix
	from the diagonal elements of the input matrix. Optionally if
	K is specified return the vector from the Kth diagonal of the
	input matrix.

	K < 0 is below the main diagonal.
	K > 0 is above the main diagonal.

See Also: tril, triu
