cell2mat error
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
"a" is a 5000x12 cell matrix. all value in "a" are numeric. I tried to convert from cell to double using cell2mat(a) and i received the following error: ??? Error using ==> cat CAT arguments dimensions are not consistent.
Error in ==> cell2mat at 89 m{n} = cat(1,c{:,n});
how can I convert this matrix to double?
0 comentarios
Respuestas (3)
Fangjun Jiang
el 15 de Ag. de 2011
Probably the numeric elements of the cell array are not the same size. See example:
a={1 2;3 4}
b=cell2mat(a)
c={1 2;[3 4] 5}
d=cell2mat(c)
0 comentarios
Danielle Leblanc
el 15 de Ag. de 2011
1 comentario
Fangjun Jiang
el 15 de Ag. de 2011
Is every element supposed to be scalar? Use the following to check the size of each element.
c={1 2;[3 4] 5};
d=cellfun(@size,c,'uni',0);
e=cell2mat(d);
f=all(e==1)
Ver también
Categorías
Más información sobre Data Type Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!