How to delete columns of a matrix containing specific values in bottom row
Show older comments
Hi. I am working on a program that generates a 2xN matrix that looks something like this
ModRows = [7 11 21 27 243 2817 3114 3489;...
2 2 4 6 13 279 1 150]
What I want to do is search the matrix for values in the second row that are below 2 and delete the respective column, so I would get something like this, for example:
ModRows = [21 27 243 2817 3489;...
4 6 13 279 150;]
I have no idea where to start. I can't use an index i from 1 to the size of ModRows, because whenever I delete a column, ModRows becomes shorter, resulting in an error.
Any help would be much appreciated!
Marc
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices 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!