How to filter the data as given below?
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
consider the following numbers.[.2,.8,55,67,689,47,105,.3,.45,67] kindly some one suggest me a program to pic the first two and remove next two..so my answer should be likely [.2,.8,689,47,.45,67]
Antworten (1)
Guillaume
am 24 Mär. 2015
data = [.2,.8,55,67,689,47,105,.3,.45,67];
indices = 1:numel(data);
indices = indices(mod(indices-1, 4) < 2);
data(indices)
You need to take the time to understand the answers you're given.
2 Kommentare
Ajay Parottil
am 25 Mär. 2015
Guillaume
am 25 Mär. 2015
You can change the number of values you want to pick and discard as much as you want, the logic is still the same. You just have to change the ratio for the modulo operation. (hint: it's twice the number of values you want to keep).
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!