Data matching and filter

1 view (last 30 days)
Mekala balaji
Mekala balaji on 20 Apr 2015
I have initial set of values are:
Initial data:
17
16
12
15
I want to search how many data points exists in the given initial data with in my criterion and I should at least have to have two data points (two matched data with in the given criterion) Initially, I check if there is any data between 6 & 8, If do not have at least two matching, then I increase searching range (or interval) +/- 2 (left 2, and right 2) i.e, 4 & 10, I still not found at least two records, then I increase my searching range 2 & 12...0&14, .. -2&16. Between -2 & 16, I can find two matched data with this interval in the data set. But I want to stop some where my searching when it crosses both min and max of given initial data set. Please kindly some one help me how to do this.
Many many thanks in advance.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!