gradientNumerical derivatives
It approximates the partial derivatives
If
If
D1 = gradient(F)D1 = gradient(F, h)[D1, D2, ..., DN] = gradient(F)[D1, D2, ..., DN] = gradient(F, h)F is an array of values of h should be a scalar (real or complex) specifying the spacing such that h is not provided.F is a vector (or scalar), it considers D1 will contain the numerical derivatives D1, D2, ..., DN will contain the numerical derivatives ndims(F). The F, respectively.ndims(F) output arguments, i.e., N > ndims(F).[D1, D2, ..., DN] = gradient(F, h1, h2, ..., hN)[D1, D2, ..., DN] = gradient(F) above, except that h1, h2, ..., hN, respectively.ndims(F) is not equal to h = 0.6.[X1,X2,X3]=ndgrid(-1:0.6:0.8);
F=X1+X2+X3;
[D1,D2,D3]=gradient(F,0.6)
D1(:, :, 1) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D1(:, :, 2) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D1(:, :, 3) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D1(:, :, 4) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D2(:, :, 1) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D2(:, :, 2) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D2(:, :, 3) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D2(:, :, 4) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D3(:, :, 1) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D3(:, :, 2) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D3(:, :, 3) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
D3(:, :, 4) =
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000
1.000 1.000 1.000 1.000