Changeset 138 for trunk/src/name_generator.m
- Timestamp:
- Nov 26, 2010, 5:44:41 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/name_generator.m
r127 r138 85 85 nom_type_mod=nom_type; 86 86 num_j_str=''; 87 if strcmp(nom_type(1),'_') 88 filename=[filename '_']; 89 nom_type_mod(1)=[]; 90 end 91 if strcmp(nom_type_mod(end),'a') 92 nom_type_mod(end)=[]; 93 num_j_str=char(num_j1+96);% lower letter corresponding to the index 94 elseif strcmp(nom_type_mod(end),'A') 95 nom_type(end)=[]; 96 num_j_str=char(num_j1+64);% lower letter corresponding to the index 97 elseif isequal(numel(regexp(nom_type_mod,'_')),1)%if a second separator '_' exists in nom_type 98 num_j_str=['_' num2str(num_j1)]; 99 nom_type_mod(regexp(nom_type_mod,'_'):end)=[]; 87 if strcmp(nom_type,'1') 88 filename=[filename num2str(num_i1) ext]; 89 elseif length(nom_type)<=1%fixed name , no indexing, for instance '*' 90 filename=[filename ext]; 100 91 else 101 num_j1_out=[];%no index j 102 end 103 if ~isnan(str2double(nom_type_mod)) 104 numtype=['%0' num2str(length(nom_type_mod)) 'd'];%indicate the number of digits (0 before the number) 105 filename=[filename num2str(num_i1,numtype) num_j_str ext]; 106 num_i2_out=num_i1_out; 107 num_j2_out=num_j1_out; 108 else %fixed name , no indexing, for instance '*' 109 % filebasesub=filebase; 110 filename=[filename ext]; 92 nom_type_mod=nom_type; 93 if strcmp(nom_type(1),'_') 94 filename=[filename '_']; 95 nom_type_mod(1)=[]; 96 end 97 if strcmp(nom_type_mod(end),'a') 98 nom_type_mod(end)=[]; 99 num_j_str=char(num_j1+96);% lower letter corresponding to the index 100 elseif strcmp(nom_type_mod(end),'A') 101 nom_type(end)=[]; 102 num_j_str=char(num_j1+64);% lower letter corresponding to the index 103 elseif isequal(numel(regexp(nom_type_mod,'_')),1)%if a second separator '_' exists in nom_type 104 num_j_str=['_' num2str(num_j1)]; 105 nom_type_mod(regexp(nom_type_mod,'_'):end)=[]; 106 else 107 num_j1_out=[];%no index j 108 end 109 if ~isnan(str2double(nom_type_mod)) 110 numtype=['%0' num2str(length(nom_type_mod)) 'd'];%indicate the number of digits (0 before the number) 111 filename=[filename num2str(num_i1,numtype) num_j_str ext]; 112 num_i2_out=num_i1_out; 113 num_j2_out=num_j1_out; 114 else %fixed name 115 filename=[filename ext]; 116 end 111 117 end 112 118
Note: See TracChangeset
for help on using the changeset viewer.