Extracts all nonzero diagonals from the m-by-n matrix A.
B is a min(m,n)-by-p matrix whose columns are the
p nonzero diagonals of A.
Usage
spdiags(A)
Value
B
A min(m,n)-by-p matrix, usually (but not necessarily)
full, whose columns are the diagonals of A.
d
A vector of length p whose integer components
specify the diagonals in A.
Arguments
A
An m-by-n matrix with nonzero elements located on p diagonals.
Author
John C. Nash (nashjc@uottawa.ca)
Details
Compared to the original Matlab implementation:
1) it does not handle the case with more than one input,
and 2) (m > n) matrices give the B matrix columns in a
different order, but the d vector of indices will also
be changed accordingly, so the set of columns is OK,
just ordered differently