How to import multiple .csv files to MATLAB?
16 views (last 30 days)
Show older comments
So what I am trying to do is import a multiple .csv (spread sheets of data) to matlab, I just wondering if there's any way or a loop that can be set so I don't have to import it manurally?
P1 = importfiles('20181109_load_0.65_P1.csv', 1, 1440);
P2 = importfiles('20181109_load_0.65_P2.csv', 1, 1440);
P3 = importfiles('20181109_load_0.65_P3.csv', 1, 1440);
P4 = importfiles('20181109_load_0.65_P4.csv', 1, 1440);
P5 = importfiles('20181109_load_0.65_P5.csv', 1, 1440);
P6 = importfiles('20181109_load_0.65_P6.csv', 1, 1440);
P7 = importfiles('20181109_load_0.65_P7.csv', 1, 1440);
P8 = importfiles('20181109_load_0.65_P8.csv', 1, 1440);
0 Comments
Answers (1)
Sean de Wolski
on 20 Nov 2018
Edited: Sean de Wolski
on 20 Nov 2018
Something along the lines of the following. You can control what you read in by setting datastore properties.
ds = datastore('*.csv')
T = readall(ds)
0 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!