How to 1 or more file i can run in my code?
    2 views (last 30 days)
  
       Show older comments
    
My code like this...
% load data
tree = load_file('Filename');
...
I get some mat files example to Name_Surname_Pattern_trynumber.fmt file. I have lots of files.So, i want to run this code each file automatically.
My file's name like this ...
Name={ 'Mert', 'Jack' , 'Jimmy' , 'John' } %%I have 46 people.
Surname= { 'Dogan', 'Surname' , 'Surname' , 'Surname'} %%I have 46 people.
Patern={ 'How','Can','Do,'This'} %%I have 9 patern
trynumber= 1:3 %%I have 3 try
0 Comments
Accepted Answer
  Jan
      
      
 on 23 Jan 2018
        Name    = { 'Mert', 'Jack' , 'Jimmy' , 'John' };
Surname = { 'Dogan', 'Surname' , 'Surname' , 'Surname'};
Pattern = { 'How','Can','Do,'This'};
trynumber = 1:3;
Folder = cd;  % Set accordingly
for iName = 1:numel(Name)
  for iPattern = 1:numel(Pattern)
    for iTry = 1:numel(trynumber)
      Filename = fullfile(Folder, sprintf('%s_%s_%s_%d.fmt', ...
          Name{iName}, Surname{iName}, Pattern{iPattern}, trynumber(iTry));
      tree = load_file(Filename);
      ...
    end
  end
end
0 Comments
More Answers (0)
See Also
Categories
				Find more on Genomics and Next Generation Sequencing 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!
