Borrar filtros
Borrar filtros

evaluating the value of the gradient at some point.

1 visualización (últimos 30 días)
Del
Del el 21 de Dic. de 2012
Comentada: Bishwesvar Pratap Singh el 27 de Mzo. de 2018
I have
syms x1 x2
f=x1^2+4*x2^2-8*x1-16*x2
f =
x1^2 - 8*x1 + 4*x2^2 - 16*x2
grad_f=gradient(f)
grad_f =
2*x1 - 8
8*x2 - 16
Now, I would like to evaluate the value of the gradient of f at some point, let say (x1,x2)=(1,0).
What should I do?

Respuestas (1)

Walter Roberson
Walter Roberson el 21 de Dic. de 2012
subs(grad_f, {x1, x2}, {1, 0})
You will likely want to double() the result of the subs()
  3 comentarios
Walter Roberson
Walter Roberson el 21 de Dic. de 2012
double(subs(grad_f, {x1, x2}, {1, 0}))

Iniciar sesión para comentar.

Categorías

Más información sobre Numbers and Precision en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by