How i can reorder the sheets of excel in matlab to do a same sheet ?
14 visualizzazioni (ultimi 30 giorni)
Hello, thank you so much for reading me, i have a question please.
How can reorder the sheets that i have in this program in matlab to do only a matrix with all the sheets? i want the original data of the archive named REN
Cyears = 9;
Cdays = 31; % Enero
RAD = nan(Cdays, Cyears); % Average daily data: dia x año
RS = xlsread('REN',i);
RAD(:, i) = 600*sum(RS)'/1000000;
figure(1); imagesc(RAD); colorbar;
Thank you in advance ..
Più risposte (1)
Image Analyst il 6 Set 2020
I'm not sure how the accepted answer does that. Maybe I didn't read closely enough. But if you want to do "only a matrix with all the sheets" in the workbook and not process any workbook where all the expected sheets are not there, then you can do this:
sheets = sheetnames('airlinesmall_subset.xlsx')
if length(sheets) == 13
% All sheets are present. We're expecting there to be 13 sheets in this workbook.
% All sheets are NOT present. Some are missing.
Now, to "reorder the sheets of excel" as you requested, there are two ways. You can either open the workbook using ActiveX (if using Windows) and then use ActiveX commands to put the sheets in whatever order you want, or you can call writecell() or writematrix() once per sheet in the desired order.