Abtract DEADLINE Need Help



I am trying to use lsqnonlin

I am calling using

x=lsqnonlin(@myfun,X0,[],[],options,DataX,DataY);

If I use this objective function it runs just fine.

function F = myfun(C,X,Y)
%C- Guess
%X- XData
%Y- YData

A= C(1);
B= C(2);
D= C(3);

F = sqrt((A.*X) + (B.*Y)) - D;

I would like for F to be
F = sqrt((A.-X)^2 + (B.-Y)^2) - D;

However if I change the *'s in F to a +'s (or -'s) then I
the following error

??? Error using ==> optim\private\lsqncommon
User supplied function failed with the following error:

Error: File: C:\Documents and Settings\Inquizitive\My
Documents\bps\myfun.m Line: 10 Column: 14
Missing variable or function.


If I leave the * in F and ^2's I get the following error


??? Error using ==> optim\private\lsqncommon
User supplied function failed with the following error:

Error using ==> mpower
Matrix must be square.

Why don't lsqnonlin tolerate addition or subtraction? Or
exponents?

.



Relevant Pages

  • Re: Parameter Pass in lsqnonlin
    ... Here is my function definition; ... I use a function in lsqnonlin ... In NonlinearLeastSquareCalib at 9 ... User supplied function failed with the following error: ...
    (comp.soft-sys.matlab)
  • Re: Parameter Pass in lsqnonlin
    ... I use a function in lsqnonlin ... I got such an error message; ... In NonlinearLeastSquareCalib at 9 ... User supplied function failed with the following error: ...
    (comp.soft-sys.matlab)
  • Re: Parameter Pass in lsqnonlin
    ... I use a function in lsqnonlin ... I got such an error message; ... In NonlinearLeastSquareCalib at 9 ... User supplied function failed with the following error: ...
    (comp.soft-sys.matlab)
  • Problem with resnorm in lsqnonlin
    ... I am using lsqnonlin. ... I noticed that when I plug in the optimal ... resnorm=sum(objfun(x*).^2) is resnorm from the PENULTIMATE iteration ...
    (comp.soft-sys.matlab)
  • Re: non linear least square (using lsqnonlin)
    ... I think you have a basic misunderstanding about what lsqnonlin does. ... It takes as the objective function a VECTOR of values and tries to minimize the sum of squares of those values. ... MATLAB mathematical toolbox documentation ...
    (comp.soft-sys.matlab)