% ycbcr color components of a 4x4 RGB subimage
% and ycbcr to RGB 
clear
%
xr=double([245  246  246  248;
  246  247  246  247;
  246  246  245  248; 
  248  247  246  248])/255; % normalized red component 
xg=double([191  196  193  190;
  192  197  192  189;
  192  197  192  189; 
  192  198  191  188])/255; % normalized green component
xb=double([222  225  223  223;
  223  226  223  222;
  223  225  222  222; 
  223  224  221  224 ])/255; % normalized blue component 
%
x=cat(3,xr,xg,xb); % rgb image
%
ycbcr=rgb2ycbcr(x); % rgb to ycbcr
% ycbcr components of a 4x4 subimage
ycbcr_y= (ycbcr(:,:,1)) % y component
ycbcr_cb= (ycbcr(:,:,2)) % cb component
ycbcr_cr= (ycbcr(:,:,3)) % cr component
rgb=ycbcr2rgb(ycbcr); % rgb to ycbcr
rgb=round(255*rgb)