How to add arrays (horz. with different dimensions/size)

2 ビュー (過去 30 日間)
Josy M
Josy M 2020 年 7 月 9 日
コメント済み: madhan ravi 2020 年 7 月 9 日
Hello :) Another simply question (but not for me)
I will add 2 arrays horizontal. See Code. Ok it works in general. But it does not work if I have:
  • array1= 1*9 string array
  • array2= 7*1 string array
How can i create an 1*16 string array? Thank for further help.
array_combination=horzcat(array1,array2)

採用された回答

madhan ravi
madhan ravi 2020 年 7 月 9 日
[array1, array2.']
  2 件のコメント
madhan ravi
madhan ravi 2020 年 7 月 9 日
編集済み: madhan ravi 2020 年 7 月 9 日
Alternatively:
[array1(:); array2(:)].'
madhan ravi
madhan ravi 2020 年 7 月 9 日
array_combination=horzcat(array1,array2.') % .' was missing

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by