Basics

13. Logical Operators

13.1. Example

% Ex_LogicalOperators.m
% Re <= 2100 laminar
% Re >= 4000 Turbulent
% 2100 < Re < 4000 transition

Re = input('Reynolds Number = ');

if Re <= 2100
    disp('Laminar');
elseif Re< 4000
    disp('Transition');
else
    disp('Turbulent');
end
    
if Re > 2100 && Re < 4000 
    disp('Modify the flow conditions please,')
    disp('as the flow regime is uncertain')
end