I have a whole bunch of 2D matrices in matlab (they\'re suppose to make up a 3D matrix where the 3rd dimension is time), and I\'m trying to make a video from the image data.
The built-in function immovie(X,map) is one option for what you want. This function expects a m-by-n-by-1-by-k
4D matrix, where the 4th dimension is the frames of the movie. Since you're starting with a 3D matrix, use permute first:
Orig; % 3D matrix
X = permute(Orig,[1 2 4 3]); % 4D matrix
movie = immovie(X,map); % map is the colormap you want to use
implay(movie);