필터 지우기
필터 지우기

Using more than one file directory path in the same script ?

조회 수: 1 (최근 30일)
ahmed
ahmed 2013년 9월 24일
I have my script like this way
dataDirectory = 'files location ';
allFilesDir = dir(fullfile(dataDirectory , '*.txt'));
allFN = {allFilesDir.name};
result = [];
for n = 1:length(allFN)
measNr(n) = str2double(regexprep(allFN{n},'**.txt',''));
myFN = (fullfile(dataDirectory, allFN{n}));
auxv =try1(myFN);
result(n,:) = mean(auxv.data);
end
then i will plot my data
I want to change the file dataDirectory to another path and perform the same code for these data . How could i do that ?

답변 (1개)

Sean de Wolski
Sean de Wolski 2013년 9월 24일
What you have there looks like would work if you added another for-loop over data directory.
Thus dataDirectory would be a cell or struct array of paths and you would loop over them.
  댓글 수: 1
Jan
Jan 2013년 9월 24일
"Seems not working" is nor a useful description of the problem. Better post your code and explain which error occurs.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by