Some applications work with collections of images related by time, such as frames in a movie, or by spatial location, such as magnetic resonance imaging (MRI) slices. These collections of images are referred to by a variety of names, such as image sequences, image stacks, or videos.
The ability to create N-dimensional arrays can provide a convenient way to store image sequences. For example, an m-by-n-by-p array can store an array of p two-dimensional images, such as grayscale or binary images, as shown in the following figure. An m-by-n-by-3-by-p array can store truecolor images where each image is made up of three planes.
The Image Viewer app and imshow can display one frame at a time, using standard MATLAB® array indexing syntax. To animate an image sequence or provide navigation within the sequence, use the Video Viewer app (implay). The Video Viewer app provides playback controls that you can use to navigate among the frames in the sequence. To get a static view of all the frames in an image sequence at one time, use the montage function.