Unrest cell of cells

15 visualizaciones (últimos 30 días)
Shunan Sheng
Shunan Sheng el 7 de En. de 2022
Comentada: Shunan Sheng el 7 de En. de 2022
Suppose I have a 1x2 cell of cells, I want to reshape the cell to a 2 x 3 cell. How can I do?
For example, the original cell is
test_cell={{1,2,3};{2,3,4}};
% we want
% 2×3 cell array
%
% {[1]} {[2]} {[3]}
% {[2]} {[3]} {[4]}

Respuesta aceptada

KSSV
KSSV el 7 de En. de 2022
test_cell={{1,2,3};{2,3,4}};
reshape([test_cell{:}],3,2)'
ans = 2×3 cell array
{[1]} {[2]} {[3]} {[2]} {[3]} {[4]}

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by