how to concatenate cells arrays

1 次查看(过去 30 天)
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

采纳的回答

the cyclist
the cyclist 2016-7-9
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)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by