I want a model in the form B = A1 * X1 + A2 * X2 + A3 * X3 + A4 * X4 + A5 * X5
A1,A2..A5 are independent variables and are column vectors. B is the dependent variable and is also a column vector.
I went through the forums and found similar posts where people have asked to use some function, fun= @(b,X) b(1).*X(:,1)+b(2).*X(:,2)+b(3).*X(:,3)+b(4).*X(:,4)+ b(5).*X(:,5);
and then 'nlinfit' command at the end,but I am getting some weird plots.
Would appreciate any kind of help. Thanks
Best Answer