Unrest cell of cells

1 view (last 30 days)
Shunan Sheng
Shunan Sheng on 7 Jan 2022
Commented: Shunan Sheng on 7 Jan 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]}

Accepted Answer

KSSV
KSSV on 7 Jan 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]}

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!