In order to present 3-D matrix data, sometimes it is better to draw some cubes with specified dimensions. But the plot functions in MATLAB cannot directly fulfil this goal. Here is one proper solution based on the integrated function
patch in MATLAB.
The control file is used to call the cube_plot.m function. You may define the origin point and the dimension for the cube. You may also plot more cubes to present 3-dimension data.
Save the following code as
That is it.