source: trunk/src/num2stra.m @ 339

Last change on this file since 339 was 332, checked in by sommeria, 13 years ago

NomType? changed from _i1-i2 ... to _1-2 ... (bugs to be expected!)
bug corrected in geometry_calib
series changed by introducing a from FileIndices?, introduction of find_file_series to detect the file series corresponding to an input file

File size: 1.3 KB
RevLine 
[8]1%'num2stra': transform number to the corresponding character string depending on the nomenclature
2%--------------------------------------------
3% function str=num2stra(num,nom_type)
4%
5% OUTPUT:
6% str: character string
7%
8% INPUT:
9% num: input number (file index)
10% nom_type: nomencalture type (see fct name_generator)
11%
12% see also: stra2num, name_generator, name2display
13
[122]14function str=num2stra(num,nom_type,index)
[332]15str='';
[8]16if ~exist('index','var')
17    index=2; %index 1 or 2 of the file indices
18end
19switch index
20    case 1
[332]21%         if length(nom_type)>=4 && isequal(nom_type(1:2),'%0') && isequal(nom_type(4),'d')
22%            str=num2str(num,nom_type(1:4));
23%         else
[8]24           str=num2str(num);
[332]25%         end
[8]26    case 2
[332]27        if isequal(nom_type(end),'a')||isequal(nom_type(end),'b')
[8]28            str=char(96+num);
29        elseif isequal(nom_type(end),'A')|isequal(nom_type(end),'B')
30            str=char(64+num);
[332]31%         elseif isequal(nom_type,'series_i')|isequal(nom_type,'netc_series')...
32%                 |isequal(nom_type,'ima_num')| isequal(nom_type,'avi')| isequal(nom_type,'none')...
33%                 isequal(nom_type,'_i')|isequal(nom_type,'_i1-i2')
34%             str='';
[8]35        else
36            str=num2str(num);
37        end
38end
Note: See TracBrowser for help on using the repository browser.