MATLAB instusion detection