MATLAB: filter nonperiodic noise in the signal I have gone through the below related posts of filtering noise from the signals

MATLAB, How to filter a discrete signal?

MATLAB: Filter a noisy EKG signal

But the signal I want to filter contains noise which is not periodic as shown in the images below:





Can anyone suggest a filtering technique for the noise labeled with red colour in the image?
You can do a non-decimated one dimensional wavelet transform on the image. Since the data is more or less homogeneous within a certain range, the outliers will be denoted by spikes in the wavelet coefficients. You can then use a threshold and remove those coefficients and perform inverse non-decimated wavelet transform. 

You can check this paper also.

Do you mind sharing a copy of the data in .mat ? I would like to test it out in order to be sure.