%% Specify Dependent Logical Conditions
% Specify a logical statement where the second condition depends on the first. In the following statement, it doesn't make sense to evaluate the relation on the right if the divisor, b, is zero.

b = 1;
a = 20;
x = (b ~= 0) && (a/b > 18.5)

% The result is logical 1 (true). However, if (b ~= 0) evaluates to false, MATLAB® assumes the entire expression to be false and terminates its evaluation of the expression early.
%
% Specify b = 0 and evaluate the same expression.

b = 0;
x = (b ~= 0) && (a/b > 18.5)

% The result is logical 0 (false). The first statement evaluates to logical 0 (false), so the expression short-circuits.
% Copyright 2012 The MathWorks, Inc.