clear all;
close all;

%%%%MathematicalModeling
figure;
for x1=0:0.1:3
  %mathematicalmodel
  x2=2*x1+3;
  for yy=0:0.1:9
    %if-then-else
    if yy>x2 
      aa=.;
    else
      aa=r.;
    end
    plot(x1,yy,aa);hold on;
  end
end


%%%% Hierarchical Modeling
figure;
for x1=0:0.1:3
  for x2=0:0.1:9
    %hierarchical model
    %nested if-then-else
    if x1<1
      if x2<3
        aa=.;
      else
        aa=r.;
      end
    else
      if x2<6
        aa=g.;
      else
        aa=m.;
      end
    end
  plot(x1,x2,aa);hold on;
  end
end