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]}
  1 件のコメント
Nimas
Nimas 2023 年 1 月 15 日
Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by