MATLAB: How to reshape nested cell arrays in a table

MATLAB

Hi,
How does one reshape nested cell arrays in Matlab ? Let's say I have something like this:
t = table({1:24}, {1:48}, {1:48}, {1:48});
t = reshape(t.Var3, [4, 12])
How can I reshape Var2, Var3 and Var4 into 4×12 arrays instead of 1×48 ?

Best Answer

t(:,2:4)=varfun(@(x) {reshape(x{:},4,12)},t(:,2:4))