## need help creating a 2D matrix of an image

### Rao (view profile)

on 30 Jul 2012

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.

Walter Roberson

### Walter Roberson (view profile)

on 30 Jul 2012

Please show us the output of

```size(ycbcr)
```

## Products

### Image Analyst (view profile)

on 30 Jul 2012

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?

Yash

on 30 Jul 2012

its 3 D info

### gargoyle (view profile)

on 2 Aug 2012

now im not sure, but i think this is what you want:

```Y=zeros(size(ycbcr(:,:,1))); %
```
```Y=ycbcr(:,:,1);
```
```Cb=zeros(size(ycbcr(:,:,2)));
```
```Cb=ycbcr(:,:,2);
```
```Cr=zeros(size(ycbcr(:,:,3)));
```
```Cr=ycbcr(:,:,3);
```

i've made 3 different empty mattrix assignments just to be explicit all the 3rd dimensions should have the same row,col size.

### faraz.a (view profile)

on 25 May 2013

I want to find matrix of 0's and 1's (for white and black pixels) for a given binary image

Image Analyst

### Image Analyst (view profile)

on 25 May 2013

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi