フィルターのクリア

Dynamic addressing of files and folders for inputting data

1 回表示 (過去 30 日間)
Sam
Sam 2013 年 12 月 2 日
回答済み: Walter Roberson 2013 年 12 月 2 日
Hi everyone,
Is it possible to create a dynamic path address in MATLAB for calling files and folders? For example we have unknown number of files where each one includes also unknown number of excel files. How is it possible to call these files and folders for a kind of processing? I need a way that somehow MATLAB recognizes the number of folders by itself and then call the files inside each folder for processing.
Many thanks, Sam

回答 (2 件)

Arturo Moncada-Torres
Arturo Moncada-Torres 2013 年 12 月 2 日
I believe dir is your best choice. For example, if you are looking for Excel files:
excelFiles = dir(fullfile(pathToDirectory,'*.xls*'));
Then, you can access the file names as
excelFiles(:).names

Walter Roberson
Walter Roberson 2013 年 12 月 2 日

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by