MATLAB codes for detecting the perceptual state of the subject based on objective criteria