clc;
clear;
close all;
%%  sign function
x = -0.01 ;
if x > 0
    y = 1
elseif x == 0
    y = 0
else
    y = -1
end
%% saturation  function
LB = -20 ;
UB = +20 ;
x = +30  ;
if x > UB
    y = UB
elseif x < LB
    y = LB
else
    y = x
end
%% foor loop   S = sum(1+2+3+ ... +n) = n*(n+1)/2
S = 0 ;
for  i = 1:100
    if mod(i , 2) == 0
        S = S + i ;   %% 1  3  6
    end
end
S
%% While loop
S = 0  ;
N = 1000 ;
i = 1 ;
while i <= N
    if i == 100
        error('I = 100');
    end
    if mod(i , 7) == 0
        S  = S + i ;
    end
    
    i  = i + 1 ;
end
S

%% switch case
A = input('Enter a character:' , 's') ; 
switch A
    case 'a' 
        y = 1
    case  'b'
        y = 2
    case  'c'
        y = 3 
    otherwise
        error('Please Enter a Correct Character (a or b or c)') ;
end



