I was asked to calculate the gradient vector of a function entered by the user WITHOUT USING THE GRADIENT COMMAND. This is what I have, but is wrong I also added how to grap

1 次查看(过去 30 天)
f = input('enter function ','s');
sf = str2sym(f);
v = symvar(sf);
g = diff(sf,v);
[x,y] = meshgrid(-5:0.2:5,-5:0.2:5);
u=eval(g(1));
v=eval(g(2));
quiver3(x,y,u,v)
  8 个评论

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by