필터 지우기
필터 지우기

how to concatenate cells arrays

조회 수: 1 (최근 30일)
Mori
Mori 2016년 7월 8일
답변: the cyclist 2016년 7월 9일
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