How does lsqnonlin fit function to data?
Ältere Kommentare anzeigen
Hello,
I am trying to use lsqnonlin for finding primitives(plane, cone,..etc) parameter such as orientation.
I have primitive's point set P and the function uses primitive equation(ex. plane equation, cylinder equation) to calculate distance between estimated primitive and P. Input x is composed of 3 variables that represents the orientation of primitive(in euler angle).
I've understand lsqnonlin searches optimal x starting from x0.
But how far does it search? Is there a limitation such as searching only near the x0? If the starting value x0 is far from ground truth, will there be problem in finding solution?
If the lsqnonlin consider's every possibility of x, the function should return correct output but it seems to come out wrong.
The code is like below:
options = optimset('Jacobian', 'on', 'Algorithm','trust-region-reflective', 'display', 'off');
x0=[v1 v2 v3];
out = lsqnonlin(@(x)distance2primitive(x, P), x0, [-Inf -pi 0], [Inf pi pi], options);
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!