Let two vectors lo and hi be given.
The job is to create a index vector like so
idx = [lo(1):hi(1) lo(2):hi(2) ...]
Where : is the colon operator.
One can assume that all entries are positve integers. Delete all pairs where lo(i) > hi(i).
For example:
idx = [1 2 3 5 6 7 8 10 11 12]
idx = [6 7 8]
Find relatively common elements in matrix rows
644 Solvers
221 Solvers
Get the elements of diagonal and antidiagonal for any m-by-n matrix
196 Solvers
146 Solvers
311 Solvers