I would like to fit a function of the form (in myfunc):
ydata = x(1) + ((1 – x(2) – x(3) * log(xdata/f))/v)
to a set of data (using lsqcurvefit or lsqnonlin). the input: ydata is a vector, xdata a matrix. I want to get an estimate of parameter x(2) and x(3) which are constants. x(1) is a constant for every entry of xdata and ydata, meaning it has the same dimension as xdata and ydata, but at some entries I know it is zero beforehand. Does one of the matlab functions allow x(1) to vary with different datapoints? And if so, how do I have to code it in myfunc? All the examples I found so far do not match my problem and I don't know how to call lsqnonlin correctly. Thank you in advance for your help.
sandra
Best Answer