create cell from array with specified size
Mostrar comentarios más antiguos
Hello,
Let mymatrix a 24x1 double, how is it possible to obtain a group as specified_sizex1 cell?
For example:
mymatrix=[1:24];
group={[mymatrix(1) mymatrix(2)],...}
Respuesta aceptada
Más respuestas (2)
Fangjun Jiang
el 19 de Dic. de 2023
0 votos
num2cell(mymatrix)
2 comentarios
Gaetano Pavone
el 19 de Dic. de 2023
Fangjun Jiang
el 19 de Dic. de 2023
mat2cell(mymatrix,[1],[6, 6, 6, 6])
mymatrix = (1:24).'
specified_size = 4;
assert(mod(numel(mymatrix),specified_size)==0, ...
'numel(mymatrix) is not a multiple of specified_size')
group = num2cell(reshape(mymatrix,[],specified_size).',2)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!