Matlab code for spatiotemporal anomaly detection