MATLAB: Reshape and Modify a cell array

cell arraysMATLABreshape

Dear Community,
I have a 294×1 cell array, where each variable is a number and from this cell I need to create 2 cell arrays each of 49×1, where each variable of this new cell arrays contains 3 variables of the first array. How would you do that?
This is what I got so far:
Last_vektor = num2cell(Ubertragungsmatrix(:,end));
Load_vector = reshape(Last_vektor,[98,1]);
Pu_tr = cell(49,1);
Pn_tr = cell(49,1);

Best Answer

Vielleicht?
C = num2cell(reshape(Ubertragungsmatrix(:, end), 294/2, []), 1);
C1 = num2cell(cellfun(@(x) {reshape(x, [], 3)}, C));
[Pu_tr, Pn_tr] = deal(C1{ : })