This function creates multiple pages when used inside a loop that is greater than the product of rows(m) x col(n) subplots. Matlab function 'subplot' would segment fault in this type of usage. This function therefore overcomes this issue.
It also output handles to all figures and sublots created.
It works by passing it the loop index and length, along with row(m) and col(n) for subplot.