- #1
hoffmann
- 70
- 0
I have restated my question even further:
Suppose I have a sorted matrix:
[ 0 0 0 1 1 1 1 3 3 3 5 6 7 8 9 9 ]
I need to remove the last value in the matrix until the number of entries that are greater than one equal the number of entries that are either 0 or 1. For the example given above, there are 16 entries. Nine entries are greater than 1 and 7 entries are less than or equal to one. I would need to remove the last two entries such that the number of entries that are greater than one equal the number of entries that are either 0 or 1.
What if I have a much larger set of values? How do code this in MATLAB?
Thanks!
Suppose I have a sorted matrix:
[ 0 0 0 1 1 1 1 3 3 3 5 6 7 8 9 9 ]
I need to remove the last value in the matrix until the number of entries that are greater than one equal the number of entries that are either 0 or 1. For the example given above, there are 16 entries. Nine entries are greater than 1 and 7 entries are less than or equal to one. I would need to remove the last two entries such that the number of entries that are greater than one equal the number of entries that are either 0 or 1.
What if I have a much larger set of values? How do code this in MATLAB?
Thanks!