配列行数が違うものを連結する方法をおしえてください。
Show older comments
AA = [1:1:10]';
>> BB = [1:1:5]';
>> CC = [AA,BB]
エラー: horzcat
連結する配列の次元が一致しません。
になります。
2 Comments
AAが10行×1列、BBが5行×1列ですが、CCは水平に連結してN行×2列のデータにしたいということでしょうか?
もし垂直に連結して15行×1列にしたいなら、セミコロンでできますが。
AA = [1:1:10]';
BB = [1:1:5]';
CC = [AA;BB]
whos
Masakazu
on 17 Feb 2023
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!