Use a loop to load .dat files (with matrices) and manipulate them
이전 댓글 표시
Hi, I have some .dat files which include measurements in a matrix form. I want to load them in matlab and in each of them to remove some of the columns.
I am trying something like this but it doesn't work:
nof=10; % number of files
for i=1:nof
D=dir('*.dat)
load (D(i)....) %????
% remove column
end
Any help?
채택된 답변
추가 답변 (1개)
Honglei Chen
2011년 11월 16일
If you use dir, it returns a struct. In your case, you should do
load(D(i).name)
instead.
HTH
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!