1
$\begingroup$
f:= x^2 y^5 + y^3z^4;
grad[x_, y_, z_] = Grad[f, {x, y, z}]; 
mat = {{ 2,1,0},{ 2, 1, 1 },{ 0,3,3 },{ 2,3,1 },{ 1, 3,1},{ 4,4,4 }    }; 
grad[##] & @@@ mat //TableForm

Is there a way to use Modulus 5 with grad in this Mathematica code?

$\endgroup$
1
$\begingroup$
Mod[Apply[ grad  , mat, {1}], 5]
| improve this answer | |
$\endgroup$
  • $\begingroup$ thanks very much, but what does {1} means here.? $\endgroup$ – pat Dec 24 '17 at 23:02
  • $\begingroup$ @pat A list with length = 1 and its only element is 1. Depth specification for Apply. $\endgroup$ – user202729 Dec 25 '17 at 0:36
  • $\begingroup$ @pat {1} is a level specifier. Mod works elementwise so Mod[Apply[ grad , mat], 5] also works! $\endgroup$ – Ulrich Neumann Dec 26 '17 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.