FUNCTION REFERENCE

isdiag

Test whether all entries off the main diagonal are zero.

Test whether all entries off the main diagonal are zero.

Syntax

tf = isdiag(A)

Accepts numeric and logical matrices, including rectangular and empty matrices.

Example

isdiag([1 0; 0 2])   % 1

Differences from MATLAB: Character and cell inputs are rejected, matching MATLAB.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.