subplot
Divide the graphics display into a grid and select one of the elements of the grid for displaying the subsequent plot.
subplot(m,n,nextplotIndex)
Inputs
m A positive integer specifying the number of rows into which to divide the display.
n A positive integer specifying the number of columns into which to divide the display.
nextplotIndex A positive integer specifying the element of the grid into which the subsequent plot is to be displayed.


Description
The elements of the grid are numbered from 1 through m*n , so, clearly, the input nextplotIndex should be in this range. The row and column indices of of the element in the grid for a given value of the inputs are given by the pair [mod((nextPlotIndex-1),m)+1, floor((nextPlotIndex-1)/n)+1]. In otherwords, the index increases by 1 vertically down along a column and by n horizontally along a row.
Example
>>for i=1:4
>  subplot(2,2,i)
>  plot(rand(20*i,1))
>  title("Subplot "+i)
>  xlabel("X Axis "+i)
>  ylabel("Y Axis "+i)
>end