複数のcsvファイルを一度に読み込みたい
이전 댓글 표시
同じフォルダに1stcap01.csv, 1stcap02.csv,1stcap03.csv . . . と複数のファイルがある時に
以下の処理を用いて、それぞれのデータの読み込みを同時に行いたいです。
1つ1つ処理をすれば良いのですが、csvファイルの数が多いため、何か良い方法がありましたらご教示いただけると幸いです。
data = readmatrix('1stcap01.csv');
idx = isnan(data(:,2));
idx_or =[0;diff(idx)]<0|[diff(idx);0]>0;
num = find(idx_or);
if mod(length(num),2)
num = [num;height(idx_or)];
end
for ii = 1:length(num)/2
A{ii,1} = data(num(2*ii-1):num(2*ii),:);
end
B = cellfun(@(x) rmmissing(x,2),A,'UniformOutput',false);
cellfun(@size,B,'UniformOutput',false)
よろしくお願いいたします。
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 スプレッドシート에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!