Question for directional derivative.

17 visualizaciones (últimos 30 días)
Hardik Sakpal
Hardik Sakpal el 28 de Oct. de 2020
Respondida: KSSV el 28 de Oct. de 2020
How to solve the following question in matlab?
u(x1,x2) = x1^2 - x2^2. Calculate the derivative of u in the direction n = (8,-8) at the point (1,1).

Respuestas (1)

KSSV
KSSV el 28 de Oct. de 2020
u = @(x1,x2) x1^2-x2^2 ;
% derivatives at point (1, 1)
x1 = 1 ; x2 = 1 ;
% derivatives
dudx1 = 2*x1 ;
dudx2 = -2*x2 ;
dudx = [dudx1 dudx2] ;
% directional derivative along (8,-8)
v = [8 -8] ;
uv = v/norm(v) ;
iwant = dudx.*uv

Categorías

Más información sobre Linear Algebra 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