what changes can I make so that all files are selected automatically
조회 수: 7 (최근 30일)
이전 댓글 표시
[files,path] = uigetfile({'.txt'},'MultiSelect', 'on');
if iscell(files)
for n = 1:length(files)
data = importdata(fullfile(path,files{n})); % fullfile including path
% save data
end
else
data = importdata(fullfile(path,files));
% save data
end
댓글 수: 0
답변 (1개)
Cris LaPierre
2021년 10월 18일
댓글 수: 2
Cris LaPierre
2021년 10월 18일
You would use uigetdir to get the path to the folder. If you do not need the path to be dynamic, you can hardcode it without using uigetdir.
Make an attempt and, if you can't get it working, share the code you wrote along with any error messages you are getting (all the red text).
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!