17 lines
385 B
Matlab
17 lines
385 B
Matlab
clear
|
|
|
|
a = true;
|
|
array_of_logicals = [1 2 3] == [2 2 4];
|
|
array_of_logicals ~= [false true false]; %[false true false]
|
|
assert(all(array_of_logicals == [false true false]));
|
|
|
|
true(1, 3); % = [true true true]
|
|
|
|
islogical(true); % true
|
|
islogical([true false]); % true
|
|
|
|
% logical not
|
|
assert(~true == false);
|
|
|
|
% checking equality of complex types
|
|
res = isequal(eye(3), [1 0 0; 0 1 0; 0 0 1]); |