I have written a function to detect outliers in data sets based on tresholds defined by relative and absolute tolerances (tol_tr, tol_ta).
[outlier_detected]=