I have a folder with 23 files named below:
'9-5365_Kr1.4_Fir.xlsx''2-4534_Op4.6_Sec.xlsx'...
I started with importing the folder in a for loop:
path = 'C:\Users\Documents\MATLAB';files = dir(fullfile(path, '*.xlsx')); for k = length(files):-1:1 %import the 23 files
filename = [path filesep files(k).name]; %do something
end myfile = 'C:\Users\Downloads\myfile.xlsx';%the excel file with 23 worksheets of data
How do I rename the worksheets in 'myfile' based on the random names in the folder?
Best Answer