How to select a specific column in matrices?
Ältere Kommentare anzeigen
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!
Akzeptierte Antwort
Weitere Antworten (1)
Monika Jaskolka
am 7 Jun. 2021
Bearbeitet: Monika Jaskolka
am 7 Jun. 2021
A = ones(4)
B = ones(4)*2
C = ones(4)*3
D = ones(4)*4
X = [A(:,2), B(:,2), C(:,2), D(:,2)]
Kategorien
Mehr zu Linear Algebra 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!