Creating Video Files with MATLAB

We can create video files, which we then integrate into multimedia publications. In principle, any video material can be used, such as recorded laboratory and field experiments, screen video captures or recorded computer animations. Here I demonstrate how to create a video of an animation with MATLAB.

The sister book MATLAB Recipes for Earth Sciences (Trauth 2015) includes recorded screen activities to demonstrate the use of MATLAB. This material was created with the software Any Screen Record Pro, freely available through the Apple App Store for macOS. A popular free software solution for both macOS and Windows is the Icecream Screen Recorder.

The book MATLAB Recipes for Earth Sciences also contains numerous animated graphics, included as videos. As an example, Chapter 6.4 of the book demonstrates the convolution of a single one within a series of zeros (a unit impulse series, marked with blue circles) with a running mean of length five, using the function conv. The convolution is performed by calculating a series of means (orange circles) for subsets of five data points from the original data series (orange rectangles). To create this video we first create the input data series by typing

The function writeVideo exports the animation in the Audio Video Interleave (AVI) format, introduced by Microsoft in 1992. We can view, edit and convert the video by using the QuickTime Player, for computers running macOS, the VLC Media Player, available for macOS, Windows and Linux, or any other video player. More advanced video editors are available both for free download (e.g., Lightworks for macOS, Windows and Linux, iMovie for macOS) or for purchase (e.g., Adobe Premiere Pro CC for macOS and Windows).

About me

I am a geoscientist, apl. professor of paleoclimate dynamics at the University of Potsdam. I have been using MATLAB since late 1992, especially for the analysis of paleoclimatic series. Please visit my university webpage http://martinhtrauth.de