lsqcurvefit in C



Hello everybody,
I have a problem with the computation time of lsqcurvefit in Matlab.
I perform a least square minimization over a set of p vectors in
matlab. But the converge takes more than a second which is not
feasible for real time. Hence i wanted to implement Least square
minimization in C to save time.

I found many different libraries, but unfortunately none of the
libraries deal with sets of Vectors but only sets of nx1 points. It
would be really great if i can find any library or a C routine which
can do least squares over a Set of vectors(technically n x m matrix)
and give me a n x 1 vector as a solution.

this is how my code in matlab looks.
[T,resnorm] = lsqcurvefit(@(x,Xdata)
sphericalLeastS(x,Xdata,b),x0,Xdata,Ydata);

Xdata is a 3 x 280 matrix. (set of vectors)
Ydata is a 3 x 280 matrix
T obtained would be a 3 x 1 vector

Thanking you
krishna
.



Relevant Pages

  • Re: Simulation using Embedded MATLAB Function block in Simulink
    ... > Coder warning: Function resolved in the MATLAB workspace and will ... > only be called during simulation.Function 'Embedded MATLAB Function' ... This error occurs because SQUARE, unlike SIN, is not part of the Embedded ... Simulink knows what size the output is. ...
    (comp.soft-sys.matlab)
  • Re: Damped least square
    ... (Peter Spellucci) ... >>> Does somebody know the matlab function or code for Damped least square ... >M is close to singular when I use least square method. ...
    (sci.math.num-analysis)
  • solving simultaneous equations with specific values
    ... mathstool. ... solving 3 equations for 3 variables but because there is square ... % eventdata reserved - to be defined in a future version of MATLAB ...
    (comp.soft-sys.matlab)

Loading