MATLAB: How to detect change in mean value of a signal

MATLABsignal processing

Hello!!!
I would like to ask for some help.
I am working with inputing a large number of time-series signals. Among these signals, there are some signals which the mean value has changed. I would ignore reading the signals which there is a change in mean value. I will give three examples of signal: 1) normal (without changing mean), 2) abrupt changing in mean value, and 3) linear changing in mean value. My goal is to detect signals which there is a change in mean and skip reading these signals.
Ps., I would like to set criteria that if the magnitude of change in mean is larger than 10,000, it will treat as there is a change of mean value. Lastly, the files of these three examples of signal are also attached.
1) Normal (✅ would like to input to matlab)
2) Abupt change (❌ do not want to input to matlab)
3) Linear change (❌ do not want to input to matlab)

Best Answer

It may need to apply "smoothing" before detecting changes larger than 10,000. Looking at your data, ~2000 points movmean will clarify whether data contains changing point or not, as shown in the followign plot.
But, please note that ~2000 points moving mean will clean-up changes in short time (such as spilke noise). So, if some of your data contains such a short-time changes, you should consider some additional detection methods.
movmean.png