%% Locate Nonzero Values
% Find the logical AND of two matrices. The result contains logical 1 (true) only where both matrices contain nonzero values.

A = [5 7 0; 0 2 9; 5 0 0]

%

B = [6 6 0; 1 3 5; -1 0 0]

%

A & B

% Copyright 2012 The MathWorks, Inc.