Dear all, I got an output file with me which contains total 1000 numbers in it.I need to filter according to following CRITERIS .. KINDLY SUGGEST
1 view (last 30 days)
Show older comments
Dear all, I got an output file with me which contains total 1000 numbers in it.I need to pick the first 50 numbers and remove the next 50 upto the end(i.e. pick 1-50 aNd remove 50-100,again pick 100-150 and remove 150-200 and goes on upto 1000..)Kindly suggest how to do this using matlab.
0 Comments
Answers (1)
Guillaume
on 24 Mar 2015
indices = 1:1000;
validindices = indices(mod(indices-1, 100) < 50);
datatokeep = data(validindices)
Note that I assume you want to keep elements 101-150 and not 100-150.
See Also
Categories
Find more on Startup and Shutdown 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!