How combine two cell arrays matlab

조회 수: 6 (최근 30일)
Igor Serafin
Igor Serafin 2019년 5월 8일
댓글: Igor Serafin 2019년 5월 8일
Hi, i want to combine two Cell array:
C =
4×2 cell array
{[0]} {[1]}
{[0]} {[1]}
{[0]} {[1]}
{[0]} {[1]}
D =
4×2 cell array
{[1]} {[1]}
{[2]} {[2]}
{[3]} {[3]}
{[4]} {[4]}
I would like to get the following Cell array:
E =
4×2 cell array
{[0 1]} {[1 1]}
{[0 2]} {[1 2]}
{[0 3]} {[1 3]}
{[0 4]} {[1 4]}
How can I do this? Thanks

채택된 답변

James Tursa
James Tursa 2019년 5월 8일
E = cellfun(@(x,y)[x y],C,D,'uni',false);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by