I know that least square method work like this:

[name]=lsqcurvefit(@obj_fun,x0,xDATA,yDATA);

where x0 is the initial values which I choose. I have also xDATA and yDATA but I have one more variable in my objective function as following

  obj_fun=Z*x(1)+x(2)*x(3)-x(3)*x(1)-Y.^2 * x(2) * Z ;

where x(1),x(2),x(3) are unknowns and Z=xDATA (a vector)

I also want to pass the values of Y in objective function which is a vector. If I do like this: 

[name]=lsqcurvefit(@obj_fun,x0,xDATA,yDATA,Y); it doesn't work. It works only if put one value of Y before calculation means just fixed Y with a number but I have a vector of Y.

Please help if somebody have experience about this.

Thanks in Advance. 

More Mahak Singh Chauhan's questions See All
Similar questions and discussions