フィルターのクリア

HELP PLEASE: Using a loop to read all files in a folder using xlsread

1 回表示 (過去 30 日間)
osminbas
osminbas 2012 年 3 月 5 日
Hello,
I have a set of files in a folder. The file names are listed as: MyFile-1, MyFile-2,... I have a code to get the data and modify it from one file. When I want to move on to the next file, I have to enter the new file name in the code. Is there a way to get the data creating a loop so that I don't have to change the file name every single time? I would like to be able to push Run and finish the folder. I use xlsread to get the data:
T=xlsread('C:\MyFolder\MyFile-1.csv','A1:A500')
I would appreciate any help.

採用された回答

Oleg Komarov
Oleg Komarov 2012 年 3 月 5 日

その他の回答 (1 件)

the cyclist
the cyclist 2012 年 3 月 5 日
If you use the command
fileInfo = dir
then the fileInfo is a structure with information about the files in the directory. You could parse that to find the csv files.

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by