%exam99p5
%%%%%%%%%%%%%%%%%%%%%%%%%%
%REGION 1
%%%%%%%%%%%%%%%%%%%%%%%%%%
m=0;s=0;
while (abs(m-50)>.01 | abs(s-20)>.01),
   U=round(20*randn(15,1))+50;
   m=mean(U);
   s=std(U);
end
m,s
U =[52     74     73    66    40    49    53    70    54    56    60     2    42    43    16]
mean(U)
std(U)
%%%%%%%%%%%%%%%%%%%%%%%%%%
%REGION 2
%%%%%%%%%%%%%%%%%%%%%%%%%%
m=0;s=0;
while (abs(m-80)>.01 | abs(s-20)>.01),
   U=round(20*randn(15,1))+80;
   m=mean(U);
   s=std(U);
end
m,s
U =[98    62    36    66    94    82    78    69   105    74    92   112    84    91    57]
mean(U)
std(U)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

close all
Ub =[52     74     73    66    40    49    53    70    54    56    60     2    42    43    16]
Uf =[98    62    36    66    94    82    78    69   105    74    92   112    84    91    57]

I=round(10*randn(22))+50;
I(4:8,3:5)=reshape(Ub,[5,3]);

I(10:20,9:19)=I(10:20,9:19)+30;

I(13:15,12:16)=reshape(Uf,[3,5]);


imagesc(I);