Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Logical-operations/Octave/logical-operations.octave
Normal file
13
Task/Logical-operations/Octave/logical-operations.octave
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
function test(a, b)
|
||||
s1 = num2str(a);
|
||||
s2 = num2str(b);
|
||||
disp(strcat(s1, " and ", s2, " = ", num2str(a&&b)));
|
||||
disp(strcat(s1, " or ", s2, " = ", num2str(a||b)));
|
||||
disp(strcat("not ", s1, " = ", num2str(!a)));
|
||||
endfunction
|
||||
|
||||
% constant true is 1, false is 0
|
||||
test(true, true);
|
||||
test(false, false);
|
||||
test(true, false);
|
||||
test(false, true);
|
||||
Loading…
Add table
Add a link
Reference in a new issue