How to obtain one excel file instead of multiple file?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jhilam Mukherjee
am 24 Apr. 2015
Beantwortet: Image Analyst
am 24 Apr. 2015
I have 10 excel file in a folder. I have fetch 1st column from each file using for loop. I want to create another excel file containing these 10 column, but I get 10 different excel file instead of one file. How can I overcome this problem?
Area{i}=xlsread(filename,sheet,'A:A');
xlswrite(strcat('D:\result_excel\AREA','.xls'),Area{i},1)
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 24 Apr. 2015
In the loop, get the filename, extract the first column into the next column of a double array or a cell array that you are building up. Then when the loop exits, create an output filename and write out the data. The FAQ has code samples.
0 Kommentare
Weitere Antworten (1)
Star Strider
am 24 Apr. 2015
I would put the xlswrite call after the for loop rather than in it.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets 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!