配列行数が違うものを連結する方法をおしえてください。
Ältere Kommentare anzeigen
AA = [1:1:10]';
>> BB = [1:1:5]';
>> CC = [AA,BB]
エラー: horzcat
連結する配列の次元が一致しません。
になります。
2 Kommentare
AAが10行×1列、BBが5行×1列ですが、CCは水平に連結してN行×2列のデータにしたいということでしょうか?
もし垂直に連結して15行×1列にしたいなら、セミコロンでできますが。
AA = [1:1:10]';
BB = [1:1:5]';
CC = [AA;BB]
whos
Masakazu
am 17 Feb. 2023
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!