MATLAB: Does “msbackadj” throw a warning about windows

Bioinformatics Toolbox

I want to get a baseline of a signal with peaks using the "msbackadj" function. The example presented in the documentation looks like this:
load sample_lo_res
YB = msbackadj(MZ_lo_res,Y_lo_res,'ShowPlot',3);
However I'm only interested in the first 1000 measurements. When I modify the code I see a warning:
YB = msbackadj(MZ_lo_res(1:1000),Y_lo_res(1:1000,:),'ShowPlot',3);
Warning: The values in the input X and/or the input parameter STEP led to only one window. The algorithm in MSBACKADJ requires several windows in order to regress
properly the baseline.
> In msbackadj (line 240)

Best Answer

You are seeing this warning because the window size (200 by default) is larger than the width of your data (86.75). Tune the 'WindowSize' and 'StepSize' parameters to values that are more appropriate for your data.
load sample_lo_res
YB = msbackadj(MZ_lo_res(1:1000),Y_lo_res(1:1000,:),'WindowSize',5,'StepSize',10,'ShowPlot',3);