subplot( m , n , p ) divides the current figure into an m -by- n grid and creates axes in the position specified by p . MATLAB® numbers subplot positions by row. ... subplot( m , n , p , 'align' ) creates new axes so that the plot boxes are aligned. This option is the default behavior.
What is the use of subplot?
subplot divides the current figure into rectangular panes that are numbered row-wise. Each pane contains an axes. Subsequent plots are output to the current pane. subplot(m,n,p) creates an axes in the p -th pane of a figure divided into an m -by- n matrix of rectangular panes.
What is the difference between plot and subplot in Matlab?
subplot places multiple figures within the same window. You can place plots within a m x n grid, where m contains the number of rows and n contains the number of columns in your figure. p determines where you want to place your plot within the grid.