Hi everyone,
I would like to create a single loop that will generate several pages of graphs. Moreover, I would like each page to contain 8 graphs. For example, if I have a matrix
A = randn(100,16);
I would like to create 2 pages of 8 graphs each. How could I change the following code in order to create the graphs in one loop
varnames_i = {'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'};time = datetime(2000,1:100,1);figure;for k = 1:8 subplot (4,2,k)filename1 = plot( time' , A( : , k ) );xlim(datenum([min(time) max(time)]))title ( varnames_i(k));hold onendsaveas(filename1, '1_8.jpg');figure;for k = 1:8 subplot (4,2,k)filename2 = plot( time' , A( : , 8+k ) );xlim(datenum([min(time) max(time)]))title ( varnames_i(8+k));hold onendsaveas(filename2, '9_16.jpg');
Best Answer