Professional Documents
Culture Documents
2017
Applications
1
07.04.2017
Syntax
DM1 && DM2
DM1 || DM2
Description
DM1 && DM2 represents a logical AND operation that employs short-circuiting behavior.
That is, DM2 is not evaluated if DM1 is logical 0 (false). Each expression must evaluate to a
scalar logical result.
b = 1;
a = 20;
x = (b ~= 0) && (a/b > 18.5)
x = logical
1
b = 0;
x = (b ~= 0) && (a/b > 18.5)
x = logical
0
2
07.04.2017
X = [1 0 0 1 1];
Y = [0 0 0 0 0];
any(X) || any(Y)
ans = logical
1
3
07.04.2017
4
07.04.2017
5
07.04.2017