MatLab already has the ability to produce three-dimensional (3D) visualisations of array data such as ‘surf’ or ‘mesh’, but these still produce flat two-dimensional figures. Sometimes the best way to interpret these data is in genuine 3D with depth. I needed this capability for my own research and finding no clues online I’ve written some code myself.
This post will show you how to create your own figures in 3D (sometimes called anaglyphs) that can be saved, shared and viewed with 3D glasses. For this post I’ll be using red/blue 3D glasses (with red over the left eye) and the MatLab ‘peaks’ example data set. Continue reading

