for文を使用して、現在のフォルダ内にある3つのcsvファイルを1つのリスト型として格納するにはどうすれば良いですか?
Afficher commentaires plus anciens
% 現在のフォルダ内にある3つのcsvを抽出
Pathlists = dir("*.csv");
% 抽出したcsv構造をセルに変換
Mylists = (struct2cell(Pathlists))';
% 全行と1列目、2列目を文字列として抽出
Mylists = string(Mylists(:,1:2));
% 完全なファイル仕様に変換
MyPath = fullfile(Mylists(:,2),Mylists(:,1));
% 空リストを作成し、以下のようなデータ型を作成したい
% data = [[file1], [file2], [file3]] 各データの値1801×11 table
data = []; % 空リスト
for n = 1:length(Pathlists)
data = readtable(MyPath(n));
end
>> data % file3のtableしか格納されないのはなぜでしょうか?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Data Import from MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!