Gradient of a function

6 ビュー (過去 30 日間)
DIEGO FOSSO
DIEGO FOSSO 2015 年 7 月 15 日
回答済み: Star Strider 2015 年 7 月 15 日
Hi, I need to express the gradient of a function (not calculate its but only write its)
For example, if we have the function f(x(1),x(2)) = x(1)+x(2)^2 we know the gradient is grad= [1,2*x(2) ].
The problem is that I can't write vectors whose elements are math functions with variables. Can anyone help me?? PS I need to solve this problem because I have to run the istruction feval(grad, x(1), x(2)) of an m.file I need to run.

回答 (1 件)

Star Strider
Star Strider 2015 年 7 月 15 日
Have you considered the gradient function?

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by