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

1 次查看(过去 30 天)
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