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
diag
function to produce diagonal matrices for whichisdiag
returns logical1
(true
).The functions
isdiag
,istriu
, andistril
are 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