MATLAB: Corp data in .dat file, not from excel but from figure.

.dat filecorpingplotting

I have over 200 .dat files with 10,000 to 50,000 data points. some of the data is useless for me (in-fact troublesome). i want to remove that data but is difficult for me to open the file in excel and remove it manually. is there any method/software that can help me in removing the unwanted data from figure? like in the figure below, the data shown in block boxes is useless (sometimes this unwanted data appears in the middle portion also). any kind of answer will be appreciated.

Best Answer

I tried many things but best way to wither-off these unwanted portions is to use threshold. here i'm taking 20% as threshold value. As i have both positive and negative sides, hence i used "b = find(amp1<a & amp1>a1);"
if true
a = max(amp1);
a = 0.2*a;
a1 = -1*a;
b = find(amp1<a & amp1>a1);
amp1(b) = 0;
amp1=(amp1(amp1~=0));
end