Tuesday, March 24, 2015

remove outliers in Matlab

This is the code i wrote lately to take away the outliers from the experimental knowledge. Something outdoors the vary from Q1-1.5IQR to Q3+1.5IQR might be eliminated.

a=[10 11 13 19 9 8 11 14 12 17 1 2 10 11 13 12 12 11 10];
IQR=iqr(a);
lowr=prctile(a,25)-1.5*IQR;
highr=prctile(a,seventy five)+1.5*IQR;
new_a=a(a>lowr & a<highr);

No comments:

Post a Comment