sbomb
Newbie level 2

nlinfit matlab
I'm trying to do a nonlinear regression with nlinfit for matlab...I keep getting errors with wrong matrix dimensions and also wrong uses of my function...so I experimented with the simplest values to see what I was doing wrong:
Independents= [1 2;3 4]
Dependents = [5;6]
coefficients = [7;8]
yhat = myfun(Independents,coefficients)
%myfun is a function that multiplies matrix Independents by vector coefficients
[Beta, r]=nlinfit(A,B,yhat,coefficients)
With these I still get the same errors...I'm not sure what I'm doing wrong. Can anyone help?
I'm trying to do a nonlinear regression with nlinfit for matlab...I keep getting errors with wrong matrix dimensions and also wrong uses of my function...so I experimented with the simplest values to see what I was doing wrong:
Independents= [1 2;3 4]
Dependents = [5;6]
coefficients = [7;8]
yhat = myfun(Independents,coefficients)
%myfun is a function that multiplies matrix Independents by vector coefficients
[Beta, r]=nlinfit(A,B,yhat,coefficients)
With these I still get the same errors...I'm not sure what I'm doing wrong. Can anyone help?