How to import multiple .csv files to MATLAB?

2 Ansichten (letzte 30 Tage)
Chi Kit Cheung
Chi Kit Cheung am 20 Nov. 2018
Bearbeitet: Sean de Wolski am 20 Nov. 2018
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);

Antworten (1)

Sean de Wolski
Sean de Wolski am 20 Nov. 2018
Bearbeitet: Sean de Wolski am 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)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by