How to filter the data as given below?
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
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]
댓글 수: 0
답변 (1개)
Guillaume
2015년 3월 24일
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
Ajay Parottil
2015년 3월 25일
Guillaume
2015년 3월 25일
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).
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!