How Would I create a matrix which contains the first and last m columns of another matrix?
1 view (last 30 days)
Show older comments
Assume that n>2m
0 Comments
Answers (1)
Benjamin Kraus
on 12 Feb 2016
Lets say you have an M-by-N matrix, and you wanted the first K and last K columns:
m = 10;
n = 20;
k = 3;
A = rand(m,n);
Asub = A(:,[1:k (end-k+1):end]);
0 Comments
See Also
Categories
Find more on Matrix Indexing 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!