My code is running through multiple excel sheets in an excel file, and is making plots according to each sheet, also I am having many excel files to analyze. 1. I want the title to indicate the sheet name of the respective plot. 2. My excel file has 10 sheets. I want 6 figures in one page, that is two pages for one excel file using subplots. my code plots 6 figures in the first page and do not create second page for the same excel file and gives error. My code looks like this:
clc;XLfile = dir;number_of_files = length(XLfile);index = 3;for index = 3:number_of_files filename = XLfile(index).name; for i=1:12 x=xlsread(filename,i,'C2:C10000'); y=xlsread(filename,i,'D2:D10000'); subplot(3,2,i) plot(x,y,'b') xlabel('Shear strain (%)','FontSize', 8) ylabel('Shear stress ratio (\tau^{\prime}/\sigma_{vo}^{\prime})','FontSize', 8) title(filename(1:end-4)) set(gcf, 'PaperPosition', [0 0 5 8]); set(gcf, 'PaperSize', [5 8]); saveas(gcf,[filename(1:end-4),'pdf']) end figureend
Best Answer