% MoreBoolean

clc
x = rand(1,5);
y = rand(1,5);
s = x>y;
NumberAbove45Line = sum(s);
fprintf('x = [ %5.2f  %5.2f  %5.2f  %5.2f  %5.2f]\n',x)
fprintf('y = [ %5.2f  %5.2f  %5.2f  %5.2f  %5.2f]\n',y)
disp(' ')
disp('s = x>y')
disp('NumberAbove45Line = sum(s)')
disp(' ')
fprintf('s = [   %1d      %1d      %1d      %1d      %1d ]\n',s)
fprintf('NumberAbove45Line = %1d\n',NumberAbove45Line)

pause
clc
x = randn(1,5);
y = randn(1,5);
s = (x>0) & (y>0);
NumFirstQuad = sum(s);
fprintf('x = [ %5.2f  %5.2f  %5.2f  %5.2f  %5.2f]\n',x)
fprintf('y = [ %5.2f  %5.2f  %5.2f  %5.2f  %5.2f]\n',y)
disp(' ')
disp('s = (x>0) & (y>0)')
disp('NumFirstQuad = sum(s)')
disp(' ')
fprintf('s = [   %1d      %1d      %1d      %1d      %1d ]\n',s)
fprintf('NumFirstQuad = %1d\n',NumFirstQuad)

pause
clc
x = randn(1,5);
y = randn(1,5);
s = (x>0) | (y>0);
NoneIn3rdQuad = all(s);
fprintf('x = [ %5.2f  %5.2f  %5.2f  %5.2f  %5.2f]\n',x)
fprintf('y = [ %5.2f  %5.2f  %5.2f  %5.2f  %5.2f]\n',y)
disp(' ')
disp('s = (x>0) | (y>0)')
disp('NoneIn3rdQuad = all(s)')
disp(' ')
fprintf('s = [   %1d      %1d      %1d      %1d      %1d ]\n',s)
fprintf('NoneIn3rdQuad = %1d\n',NoneIn3rdQuad)

pause
clc
x = randn(1,5);
y = randn(1,5);
s = (x<0) & (y<0);
SomeIn3rdQuad = any(s);
fprintf('x = [ %5.2f  %5.2f  %5.2f  %5.2f  %5.2f]\n',x)
fprintf('y = [ %5.2f  %5.2f  %5.2f  %5.2f  %5.2f]\n',y)
disp(' ')
disp('s = (x<0) & (y<0)')
disp('SomeIn3rdQuad = all(s)')
disp(' ')
fprintf('s = [   %1d      %1d      %1d      %1d      %1d ]\n',s)
fprintf('SomeIn3rdQuad = %1d\n',SomeIn3rdQuad)
