Hi,
The problem is that your variable MZ does not span a large enough range for the default algorithm options of msbackadj. The algorithm needs to be able to analyze multiple shifting windows of data. The default window size is 200 separation units. I am guessing your MZ data does not have a range of at least 200 separation units, leading to the error you see.
In MATLAB R2015a and later, msbackadj gives a warning and tries to proceed anyway. However, in all versions, the best thing for you to do would be to change the algorithm options WindowSize and StepSize to values that are more appropriate for your data. For example, it looks like your data has a range of 25 separation units. Perhaps it would make sense to break your data into 5 windows of 5 separation units each. Try the following:
yb= msbackadj(MZ,a,'WindowSize',5,'StepSize',5);
Best Answer