CAT arguments dimensions are not consistent. in the cell array.

Hi every one...
I have a cell array containing cell array like this
C =
{1x1 cell} {1x32 cell} {1x32 cell} {1x64 cell} {1x64 cell} {1x1 cell};
i have tried this function
x=cellfun(@cell2mat,C','UniformOutput',false);
i'm getting this error:CAT arguments dimensions are not consistent
however i came to know C(1,1) are same rows and columns but 2nd cell array containing 1row 32 columns of cell array if anyone the solution please let me know.
thanks in advance

2 comentarios

What do you want to get?
I want to get exact matrix value in that cell array

Iniciar sesión para comentar.

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 7 de Dic. de 2012
Editada: Azzi Abdelmalek el 7 de Dic. de 2012
Maybe you are looking for
C={num2cell(rand(1,3)),num2cell(rand(1,6))}
x=cell2mat(cellfun(@cell2mat,C,'Un',0))

3 comentarios

Ya i have tried same in C:
C(1)->containing 1x1 cell but
C(2)->containing 1x32 cell like this
C 1x32= Columns 1 through 5
[16x12 double] [16x12 double] [16x12 double] [16x12 double] [16x12 double]
Columns 6 through 10
[16x12 double] [16x12 double] [16x12 double] [12x16 double] [12x16 double]
Columns 11 through 15
[12x16 double] [12x16 double] [12x16 double] [12x16 double] [12x16 double]
Columns 16 through 20
[12x16 double] [16x12 double] [16x12 double] [16x12 double] [16x12 double]
Columns 21 through 25
[16x12 double] [16x12 double] [16x12 double] [16x12 double] [12x16 double]
Columns 26 through 30
[12x16 double] [12x16 double] [12x16 double] [12x16 double] [12x16 double]
Columns 31 through 32
[12x16 double] [12x16 double]
so now you understood my concept i think its possible to convert matrix i'm waiting for valuable reply.
Vasu, I see that you have different sizes array? It's not clear what do you want to get. But if you want acces to any element:
C1={rand(16,12),rand(12,16)}
C2={rand(1,3)}
C={C1,C2} % example
C{1}(1) % the first element of C1
C{1}(2) % the second element of C1
Hi Azzi Abdelmalek from your second code i got idea to extract the matrix thank you so much.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by