I want to create a three dimensional grid (x,y,z) in mathematica and plot a function f(x,y,z) on it. I am not worried about the plotting part now; for that I will probably use ListContourPlot3D or something like that. But, I am having problem in creating the grid itself. In matlab, one can achieve this by Meshgrid command which takes either two or three variable. There are many nice ways to reproduce the two variable meshgrid equivalent in mathematica as discussed in this stackexchange question: Simulate MATLAB's meshgrid function
However, what should be the equivalent for 3D case? I am trying a combination of Riffle and Partition, but it's getting too long and confusing. Any help will be much appreciated. Thanks!!