Implementation of Anomaly Detection Algorithm in matlab