isdiag
Determine if matrix is diagonal
Syntax
Description
tf = isdiag( returns logical A)1
(true) if A is a diagonal matrix.
Otherwise, it returns logical 0
(false).
Examples
Input Arguments
More About
Tips
Use the
diagfunction to produce diagonal matrices for whichisdiagreturns logical1(true).The functions
isdiag,istriu, andistrilare special cases of the functionisbanded, which can perform all of the same tests with suitably defined upper and lower bandwidths. For example,isdiag(A) == isbanded(A,0,0).
Extended Capabilities
Version History
Introduced in R2014a