Extract values between successive start stop indexes from a signal
1 view (last 30 days)
Show older comments
Hello everyone,
I have data with defined start and stop indexes. However for further processing i have to extract only the values between those starts stops for computing several variables. The circles below are the starts and the stars are the stops. I need to perform computational operations only between those intervals. So is there a way to extract only the data between those regions?
Really appreciate any help. Thanks a lot.
0 Comments
Accepted Answer
darova
on 20 Aug 2019
I think there are tricks with vectorizing but i like simple and clear solution even it's slower
x0 % your data
x = [];
ind = [1 4 7 9 12 15]; % i want data between (1,4) (7,9) (12,15)
for i = 1:2:length(ind)-1
j = ind(i):ind(i+1)
x = [x x0];
end
2 Comments
darova
on 20 Aug 2019
Of course!
ind = [];
for k = 1:length(locs)
curr_ind = startIndex1(k):stopIndex1(k);
ind = [ind curr_ind];
end
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!