MATLAB: How to use resolve griddedinterpolant error in the msbackadj in bioinformatics toobox

Bioinformatics Toolboxgriddedinterpolantmsbackadj

The program is successfully running msbackadj using the example of baseline correction. The code is:
load sample_lo_res;
YB = msbackadj(MZ_lo_res,Y_lo_res,'SHOWPLOT',3);
But my data is not running, The code is:
load data.mat
yb= msbackadj(MZ,a);
error shown is:
Error using griddedInterpolant Interpolation requires at least two sample points in each dimension.
Error in interp1 (line 186) F = griddedInterpolant(X,V,method);
Error in msbackadj (line 282) b = interp1(Xpt+Xw/2,WE(1:numWindows),X(:,nnss),regressionMethod);
what is my data not processing?
I am attaching image of my data too.

Best Answer

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);