フィルターのクリア

Importing multiple non numeric .txt files and assigning file name as variable

1 回表示 (過去 30 日間)
bugatti79
bugatti79 2013 年 10 月 18 日
回答済み: Walter Roberson 2013 年 10 月 18 日
Hi Folks,
I am trying to import multiple non numeric .txt files and assign each file name as variable. Here is some code but it is not working properly. Ie, it creates a 8 1*1 struct array containing the name, date bytes etc but not the actual numerical data. I suspect the last line is not correct...
files = dir('C:\Test\');
for i=3:size(files, 1)
DELIMITER = ',';
HEADERLINES = 1;
a = importdata(files(i).name, DELIMITER, HEADERLINES );
end
Any ideas? B

採用された回答

Walter Roberson
Walter Roberson 2013 年 10 月 18 日
Assign to a{i-2} instead of to "a". What you have now will drop all but the last file's data.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by