clear all
clc
a=10
b=4
% a=1 b=2 c=3
type=input('type','s')
x=input ('x=')
switch lower(type)
case ('1')
if x>2
f=x^2+2*x
elseif x<2
f=x^2
else x=2
f=40
end
case '2'
if x>8
f=a+b
elseif x<8
f=a*x^2
else f=100