Dear all,
suppose I have a vector of names:
vectorOfNames = {'A','B','C'};
and my goal is to iterate through this vector
for s = 1:length(vectorOfNames)
path1 = strcat('AAAAAAAA/',char(vectorOfNames(s)),'/AAAAAAA');
keepCode(1,s) = {path1};
path2 = strcat('BBBBBBBBbbbb/',char(vectorOfNames(s)),'/bbbbbbbbb');
keepCode(2,s) = {path2};
path3 = strcat('ccccccc/',char(vectorOfNames(s)));
keepCode(3,s) = {path3};
end
and use each of name to get the paths below, which are stored in an array:
My question: is there any possibility to modify this code to iterate over 2 loops, the first loop over the names (as is) and the second loop over the paths, given that the names are part of the paths and are variable. In this example, there are only 3 types of paths, but in fact I have 35 of them, and doing it the way I showed just makes the code too extensive.
Kind regards,
Joanna Przeworska