I am trying to some cell arrays containing matrices of different sizes stored at designated index points to arrays. See the below desired outputs.
% First Cell Input
cellname = {... [1 1 1; ... 2 2 2; ... 3 3 3], ... [1 1 1; ... 2 2 2; ... 3 3 3; ... 4 4 4; ... 5 5 5; ... 6 6 6], ... [1 1 1; ... 2 2 2; ... 3 3 3; ... 4 4 4; ... 5 5 5; ... 6 6 6; ... 7 7 7; ... 8 8 8; ... 9 9 9]};% Summed rowise to the below matrix
output1 =[9 18 27 16 30 36 21 24 27]output1b =[3 3 3; ... 6 6 6; ... 9 9 9; ... 8 8 8; ... 10 10 10; ... 12 12 12; ... 7 7 7; ... 8 8 8; ... 9 9 9]% Second Cell Input
cellname2 = {... [1 2 3; ... 1 2 3; ... 1 2 3], ... [1 2 3 4 5 6; ... 1 2 3 4 5 6; ... 1 2 3 4 5 6], ... [1 2 3 4 5 6 7 8 9; ... 1 2 3 4 5 6 7 8 9; ... 1 2 3 4 5 6 7 8 9]};% Summed columnwise to the below matrix
output2 = [9 18 27 24 30 36 21 24 27]output2b = [3 6 9 8 10 12 7 8 9; ... 3 6 9 8 10 12 7 8 9; ... 3 6 9 8 10 12 7 8 9]
Best Answer