Problem 2172. Delete the rows in the middle
We will delete the rows in the middle and keep the first and the last rows.
For example if input is
[1 2 1 7 1 8 1 6 1 5]
then output will be
[1 2 1 5]
keeping the first and the last rows. However there will be more than one row index and that makes this question challenging.
Note: Elements of input row index is always greater than or equal to 2.
Related Challenge - Problem 2084. Sum Rows
Solution Stats
Problem Comments
-
2 Comments
The description of this problem is not very clear. It's really asking for the first and last row for each unique value in the first column.
"However there will be more than one row index and that makes this question challenging." - that really explains nothing to me
Solution Comments
Show commentsProblem Recent Solvers31
Suggested Problems
-
2762 Solvers
-
Remove the polynomials that have positive real elements of their roots.
1703 Solvers
-
Project Euler: Problem 10, Sum of Primes
1895 Solvers
-
Back to basics 6 - Column Vector
1075 Solvers
-
Matrix of almost all zeros, except for main diagonal
184 Solvers
More from this Author92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!