MATLAB: Create matrix of vector from 3 differents cell array

arrayarrayscell arraycell arrayselseerrorforfor loopfunctionif statementindexindexingloopMATLABmatrix array

Hi,
I have the followinf three cell arrays
a = {[1 0 1 0 1 0 0 0 1 1] , [1 1 1 0 0 0 1 0 1 0 1], [1 0 1 0 1 0 1 1 1 1 0 0 0 0]};
b = {[1 0 1 1 1 0 1 0 0 1] , [1 0 0 0 0 0 1 1 1 0 1], [1 1 1 1 1 0 1 0 0 1 0 0 0 0]};
c = {[1 0 1 1 1 0 1 0 0 1] , [1 0 0 0 0 0 1 1 1 0 1], [1 1 1 1 1 0 1 0 0 1 0 0 0 0]};
I would like to create new cell arrays. the number of cell arrays to be created are equal to length(a).
The first cell array should contain the first arrays of each cell arrays
A = {[1 0 1 0 1 0 0 0 1 1], [1 0 1 1 1 0 1 0 0 1], [1 0 1 1 1 0 1 0 0 1]}
The second cell array should contain the second arrays of each cell arrays
B = {[1 1 1 0 0 0 1 0 1 0 1], [1 0 0 0 0 0 1 1 1 0 1], [1 0 0 0 0 0 1 1 1 0 1]}
The third cell array should contain the third arrays of each cell arrays
C = {[1 0 1 0 1 0 1 1 1 1 0 0 0 0], [1 1 1 1 1 0 1 0 0 1 0 0 0 0] , [1 1 1 1 1 0 1 0 0 1 0 0 0 0]}
How can I do to obtain this result?
The length of a should vary, so it's necessary a loop that consider how many arrays are contained in a.

Best Answer

W = cellfun(@(x,y,z) {x,y,z},a,b,b,'un',0) % W{1} is A and so on