MATLAB: How to use msbackadj without error

background reductioninterpolationMATLABmsbackadj

I am trying to reduce the background on a Raman spectrum. I have two 1011×1 doubles. One is wavelength and the other is intensity. When I try the command
YB = msbackadj(Wavenumber, Intensity)
I get the following errors:
Error using griddedInterpolant
Interpolation requires at least two sample points in each dimension.
Error in interp1 (line 161)
F = griddedInterpolant(X,V,method);
Error in msbackadj (line 296)
b = interp1(Xpt+Xw/2,WE(1:numWindows),X(:,nnss),regressionMethod);
Any help would be appreciated.

Best Answer

Hello,
The problem seems to be that my data was in reverse order. As in the wavenumber went from highest to lowest. Using the flip() function on my data corrected the error.