How can i go through a folder with a loop?

4 次查看(过去 30 天)
I have a folder full of different csv files. I need to run the same script for each one of them.
How can i do that?
Thanks in advance.

采纳的回答

KSSV
KSSV 2018-2-27
files = dir('*.csv') ; % you are in folder of csv files
N = length(files) ; % total number of files
% loop for each file
for i = 1:N
thisfile = files(i).name ;
% do what you want
end
  1 个评论
rebecca wise
rebecca wise 2020-2-3
How would I then direct matlab to calculate the mean of the same column and sheet of all files?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by