i have an ycbcr image and i want to get the cb cr planes in a single 2d matrix .
Y=ycbcr(:,:,1); Cb=ycbcr(:,:,2); Cr=ycbcr(:,:,3);
by this im getting three 1d matrices but i want to get the color information i.e cbcr planes in a single 2d matrix.
That doesn't make sense to me. You have everything you need. For a given pixel at a given (row, column) you have all three component's values. What is this other thing you're trying to derive, why do you want it, and why would it be more useful than the 3D color image?
now im not sure, but i think this is what you want:
i've made 3 different empty mattrix assignments just to be explicit all the 3rd dimensions should have the same row,col size.