How to import multiple data from .csv and analyse them?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Bianca Motfolea
am 4 Dez. 2018
Beantwortet: Bob Thompson
am 4 Dez. 2018
I have experimental data in 20 .csv files and I need to take a column from each of them to do the average and then to apply the formula and transform pressure in velocity. At the end I will need to plot everything.
I know how to do this for each of them but I don't know how to do a loop or something that woud give me the averages for the .csv filles at once.
0 Kommentare
Akzeptierte Antwort
Bob Thompson
am 4 Dez. 2018
files = dir('Your file directory'); % I suggest adding a *.csv to this to only get the .csv files.
for i = 1:length(files)
raw = csvread(files(i).name);
data(:,i) = raw(:,1); % Pick your column.
end
ave = mean(data); % Gives mean values of each set of data. Adjust as desired.
This is the basic structure I use for these types of things. Adjust as needed.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!