Borrar filtros
Borrar filtros

Create matrix of vector from 3 differents cell array

3 visualizaciones (últimos 30 días)
luca
luca el 1 de Ag. de 2019
Respondida: madhan ravi el 1 de Ag. de 2019
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.

Respuesta aceptada

madhan ravi
madhan ravi el 1 de Ag. de 2019
W = cellfun(@(x,y,z) {x,y,z},a,b,b,'un',0) % W{1} is A and so on

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by