Import and export excel files
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello everyone,
I am trying to collect data of column "C" from each excel file and export the data into an excel file using for loop function.
When I open up the exported file "Load_of_samples", All data are the same as the column of the "first" excel file. (column A is the data from the first excel file, and the rest of columns (B~D) are the same as column A.
I am wondering what I did wrong.
Thank you.

XLfile = dir('*.csv');
number_of_files = length(XLfile);
OutputFileName = 'Load_of_samples';
for i = 1:number_of_files
filename = XLfile(i).name;
for i = 1:number_of_files
A(:,i) = xlsread(filename,1,'C:C');
end
xlswrite(OutputFileName,A);
end
0 Kommentare
Antworten (1)
Siehe auch
Kategorien
Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!