Filtering a large vector by two separate vectors with ranges
Show older comments
I have a large dataset with about 140,000 rows, I am trying to filter out the rows into certain ranges, which I have stored in two separate column vectors: 1 column for the start indeces, and one for the end indeces. I want to form a vector of this form: [start(1):end(1) start(2):end(2) .... ]. Since each range is not equal in value, I am having trouble using a loop to join the vectors together. Any help is appreciated, Thank you.
Example:
Start = [1; 10; 20];
End = [5; 17; 25];
Desired Result: [1 2 3 4 5 10 11 12 ... 17 20 21 ... 25]
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!