How to select a specific column in matrices?
Show older comments
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!
Accepted Answer
More Answers (1)
Monika Jaskolka
on 7 Jun 2021
Edited: Monika Jaskolka
on 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)]
Categories
Find more on Linear Algebra 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!