MATLAB 中怎么求N维向量函数的梯度,求完怎么赋值?

2025-01-03 21:58:23
推荐回答(1个)
回答1:

[FX,FY] = gradient(F) returns the numerical gradient of the
matrix F. FX corresponds to dF/dx, the differences in x (horizontal)
direction. FY corresponds to dF/dy, the differences in y (vertical)
direction.
When F is a vector, DF = gradient(F) is the 1-D gradient.