Does lsqnonlin handle a matrix objective function?
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nat A
el 17 de Mzo. de 2024
Comentada: Matt J
el 17 de Mzo. de 2024
How does lsqnonlin handle a matrix?
assuming something like
[Final_Ests,resNormal] = lsqnonlin(LSQ_obj_fnctn,initialGuess,LB,UB);
will the results be the same if LSQ_obj_fnctn is a matrix vs being a single vector made up of matrix rows?
i.e. matrix:
LSQ_obj_fnctn = rand(4,10)
vs. vector made up of matrix rows
LSQ_obj_fnctn = rand(1,40)
To be clear, I'm not actually trying to minimize a randomly generated matrix or vector, just trying to show an example of the form of what I'm passing to lsqnonlin. My results seem to indicate both matrix and vector objective functions give the same result, but I just want to be triple sure I'm not misunderstanding something.
Thanks!
0 comentarios
Respuesta aceptada
Matt J
el 17 de Mzo. de 2024
Editada: Matt J
el 17 de Mzo. de 2024
The matrix dimensions of the objective function output can be whatever you wish. It doesn't affect anything. The initialGuess can also be array-valued, although there are bugs in that feature in older versions.
Note that a closely related function lsqcurvefit,
can also have matrix-valued fun, but the ydata argument must have the same matrix dimension.
2 comentarios
Matt J
el 17 de Mzo. de 2024
Your welcome, but if this answers your question, please Accept-click the answer.
Más respuestas (0)
Ver también
Categorías
Más información sobre Linear Least Squares en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!