Cut the last n of matrix row ?
4 views (last 30 days)
Show older comments
e.g i have matrix a :
1
2
3
4
5
6
7
i want to cut the last 2 row of matrix A ? and become
1
2
3
4
5
0 Comments
Accepted Answer
Andrei Bobrov
on 25 Mar 2013
Edited: Andrei Bobrov
on 25 Mar 2013
a = (1:7)'; n = 2;
A = a(1:end - n);
or
a(end - [n-1, 0]) = [];
More Answers (0)
See Also
Categories
Find more on Multidimensional Arrays 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!