Bounding data in matlab

46 views Asked by At

Demo data

Data set can be found here : Dataset Each point (x;y) indicated the value (y) of the xth sample measured

I am trying to bound a data region which has the most data points just like in the figure , by using 2 line y=a and y=b How can i approach this solution

1

There are 1 answers

2
Tommaso Belluzzo On

Let's say your minimum and maximum for y values are respectively 960 and 972:

y(y < 960) = 960;
y(y > 972) = 972;

Alternatively, you can remove those outliers instead of bounding them:

y_idx = find((y < 960) | (y > 972));
x(y_idx) = [];
y(y_idx) = [];