%% 3-D Inverse Transform
% You can use the ifftn function to convert multidimensional data sampled in frequency to data sampled in time or space.  The ifftn function also allows you to control the size of the transform.
% Create a 3-by-3-by-3 array and compute its inverse Fourier transform.

Y = rand(3,3,3);
ifftn(Y);

%
% Pad the dimensions of Y with trailing zeros so that the transform has size 8-by-8-by-8.

X = ifftn(Y,[8 8 8]);
size(X)

% Copyright 2012 The MathWorks, Inc.