What I did was saving the three dimension matrix(30*30*30) in a file with 2700 lines, each 900 lines is a 30 by 30 matrix. Then 'load' the file in matlab. After that, you can set up a 30by30by30 3-D matrix and write a small script to assign value of each element of the 3-D matrix from the 2-D matrix you loaded.