tt = Flatten[Table[{x, y, z, btot[x, y, z]}, {x, -1, 1, 0.1}, {y, -1, 1,0.1}, {z, -1, 1, 0.1}], 2]; ff = Interpolation[tt] Till here it is working fine as it is returning the values of the interpolated function at various {x,y,z} points.
Then I want to find the gradient of this interpolated function. But when I am using
ffd[x_,y_,z_]:= D[ff[x,y,z],{{x,y,z}}] I am not getting the gradient.
:=in your code with=and it should work $\endgroup$:=with=. $\endgroup$Remove[ffd]before trying with=. $\endgroup$