Mercurial > octave
comparison scripts/general/gradient.m @ 23084:ef4d915df748
maint: Merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 23 Jan 2017 14:27:48 -0500 |
parents | 3a2b891d0b33 e9a0469dedd9 |
children | 092078913d54 |
comparison
equal
deleted
inserted
replaced
23081:7485462a6924 | 23084:ef4d915df748 |
---|---|
304 %! df_dx = @(x, y) cos (x) .* cos (y); | 304 %! df_dx = @(x, y) cos (x) .* cos (y); |
305 %! df_dy = @(x, y) -sin (x) .* sin (y); | 305 %! df_dy = @(x, y) -sin (x) .* sin (y); |
306 %! [dx, dy] = gradient (f, xy); | 306 %! [dx, dy] = gradient (f, xy); |
307 %! assert (dx, df_dx (xy (:, 1), xy (:, 2)), 0.1); | 307 %! assert (dx, df_dx (xy (:, 1), xy (:, 2)), 0.1); |
308 %! assert (dy, df_dy (xy (:, 1), xy (:, 2)), 0.1); | 308 %! assert (dy, df_dy (xy (:, 1), xy (:, 2)), 0.1); |
309 |