## Goals

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

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.

clf; |

## The cube_plot.m function

Save the following code as `cube_plot.m`

function cube_plot(origin,X,Y,Z,color) |

That is it.

Cheers!