How to select a specific column in matrices?
古いコメントを表示
I have four (4x4) matrices A B C D. I need to put all the second colums of the four matrices in another matrix X. I tried using
xdatatemp = xdata(:,[end 2]); X = xdatatemp
but it shows an error. Thank you in advance!
採用された回答
その他の回答 (1 件)
Monika Jaskolka
2021 年 6 月 7 日
編集済み: Monika Jaskolka
2021 年 6 月 7 日
A = ones(4)
B = ones(4)*2
C = ones(4)*3
D = ones(4)*4
X = [A(:,2), B(:,2), C(:,2), D(:,2)]
カテゴリ
ヘルプ センター および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!