# Conversion between multichannel and multidimensional matrices

Is there a direct way to convert from a multichannel matrix to a multidimensional matrix (and vice versa)?

For example, in the following code snippet, how could I convert `A`

such that it has the same shape as `B`

?

```
const int sizes[3] = {50, 50, 3};
cv::Mat A(3, sizes, CV_64F);
cv::Mat B(50, 50, CV_64FC(3));
```

`cv::Mat B = Mat::zeros(50, 50, 3);`

looks invalid. (using hardcoded`3`

for "type") please check again.Thanks, fixed.

sorry, but it's probably stiill wrong

thanks, I removed the zeros part.

sorry, but still, no cigar here

(please try to compile it before posting, just saying)

ooooook ;)