function diff = yoursimp(params,X,Y)
% This function is called by LSQNONLIN.
% x is a vector which contains the coefficients of the
% equation. X and Y are the option data sets that were
% passed to lsqnonlin.

B=params(1);
M=params(2);
diff = B+M.*X - Y;
end
Input argument "params" is undefined.

Error in ==> yoursimp at 8
B=params(1);