- #1
ergospherical
- 1,072
- 1,365
I have two 1D matrices X(1,j) and Y(1,j) of equal length. To fit Y to a model asin(bx) I tried:
this gives the message: Error using fittype>iDeduceCoefficients
The independent variable x does not appear in the equation expression.
Use x in the expression or indicate another variable as the independent variable.
What's wrong?
Matlab:
fit = fittype(@(a,b,X), a*sin(b*X));
[fitted, gof] = fit(X, Y, fit)
coefficients = coeffvalues(fitted)
The independent variable x does not appear in the equation expression.
Use x in the expression or indicate another variable as the independent variable.
What's wrong?