How to combine elements from cell?

조회 수: 1 (최근 30일)
Nimas
Nimas 2023년 1월 15일
댓글: Nimas 2023년 1월 15일
I have two 4x4 cells
a =
[10] [11]
[12] [13]
b =
[20] [21]
[22] [23]
How to combine a and b like this?
[10,20] [11,21]
[12,22] [13,23]

채택된 답변

Stephen23
Stephen23 2023년 1월 15일
a = {10,11;12,13}
a = 2×2 cell array
{[10]} {[11]} {[12]} {[13]}
b = {20,21;22,23}
b = 2×2 cell array
{[20]} {[21]} {[22]} {[23]}
c = cellfun(@horzcat,a,b, 'uni',0)
c = 2×2 cell array
{[10 20]} {[11 21]} {[12 22]} {[13 23]}

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by