Borrar filtros
Borrar filtros

how to concatenate cells arrays

1 visualización (últimos 30 días)
Mori
Mori el 8 de Jul. de 2016
Respondida: the cyclist el 9 de Jul. de 2016
I have 2 cells array including A B , each has 4 cells. Each cell of A has 2 or 3 records (e.g. 10 columns and 1 row). B has 2 records.
How I can concatenate these two (A,B) to create new cell array C like below in the picture.
A={[1 1] [2 2 2]; [3 3] [4 4]} B={[5 5] [6 6]; [7 7] [8 8]} and I want
C={ [1 1 5 5] [2 2 2 6 6]; [3 3 7 7] [4 4 8 8] }
Thank you

Respuesta aceptada

the cyclist
the cyclist el 9 de Jul. de 2016
A={[1 1] [2 2 2]; [3 3] [4 4]}
B={[5 5] [6 6]; [7 7] [8 8]}
C = cellfun(@(x,y)[x,y],A,B,'UniformOutput',false)

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by