The objective function needs to be coded as:
with the complete lsqnonlin call being:
f=@(c,x) c(1).*(x(:,1).^c(2)).*(x(:,2).^c(3)).*(x(:,3).^c(4))./x(:,4)-1;
ffcn = @(c) f(c,x) - y;
c0=[1;1;1;1];
C = lsqnonlin(ffcn, c0);
producing:
C =
1.0308e-01
1.3246e+00
1.9801e-06
-4.6017e-01
.
0 Comments
Sign in to comment.