Code covered by the BSD License  

Highlights from
mexSparseLogical0Diag

from mexSparseLogical0Diag by Guy
Change all the elements on the main diagonal of a logical sparse matrix to 0.

mexLogicalSparse0Diag(A) %#ok
function B = mexLogicalSparse0Diag(A) %#ok<STOUT,INUSD>
%MEXLOGICALSPARSE0DIAG - turn all the elements on the main diagonal to zero.
%   B = MEXLOGICALSPARSE0DIAG(A) - returns a copy of A with zeros on the
%   main diagonal. A must be sparse and logical, or an error will be
%   returned.


error(['This function requires a mex file.  Type "mex',...
    'mexLogicalSparse0Diag.c" at the prompt to build the mex file.']);

Contact us at files@mathworks.com