How to write anonymous funtion to solve with lsqnonlin

1 visualización (últimos 30 días)
Kothapelli Chandar
Kothapelli Chandar el 10 de Dic. de 2015
Comentada: Torsten el 11 de Dic. de 2015
f(x) = f1(x)^2+f2(x)^2+...+fn(x)^2 + lambda*norm(x)

Respuesta aceptada

Torsten
Torsten el 10 de Dic. de 2015
function F = myfun(x)
F(1) = f1(x);
F(2) = f2(x);
...
F(n) = fn(x);
The constant L can be omitted since it does not influence the optimal x.
Best wishes
Torsten.
  2 comentarios
Kothapelli Chandar
Kothapelli Chandar el 10 de Dic. de 2015
Hi Torsten, thank you for the answer. if the term is not a constant and a dependent on x ?
Torsten
Torsten el 11 de Dic. de 2015
Then use an (n+1)-th function f_(n+1)(x)=sqrt(L) if L is positive.
Best wishes
Torsten.

Iniciar sesión para comentar.

Más respuestas (0)

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!

Translated by