Clear Filters
Clear Filters

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

1 view (last 30 days)
I have my script like this way
dataDirectory = 'files location ';
allFilesDir = dir(fullfile(dataDirectory , '*.txt'));
allFN = {};
result = [];
for n = 1:length(allFN)
measNr(n) = str2double(regexprep(allFN{n},'**.txt',''));
myFN = (fullfile(dataDirectory, allFN{n}));
auxv =try1(myFN);
result(n,:) = mean(;
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 ?

Answers (1)

Sean de Wolski
Sean de Wolski on 24 Sep 2013
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 Comment
Jan on 24 Sep 2013
"Seems not working" is nor a useful description of the problem. Better post your code and explain which error occurs.

Sign in to comment.


Find more on Search Path in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!