source: trunk/src/num2stra.m @ 230

Last change on this file since 230 was 122, checked in by sommeria, 14 years ago
File size: 1.4 KB
Line 
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
14function str=num2stra(num,nom_type,index)
15if ~exist('index','var')
16    index=2; %index 1 or 2 of the file indices
17end
18switch index
19    case 1
20        if length(nom_type)>=4 && isequal(nom_type(1:2),'%0') && isequal(nom_type(4),'d')
21           str=num2str(num,nom_type(1:4));
22        else
23           str=num2str(num);
24        end
25    case 2
26        if isempty(nom_type)
27            nom_type='none';
28        end
29        if isequal(nom_type,'png_old') || isequal(nom_type,'netc_old') || isequal(nom_type,'raw_SMD')||...
30            isequal(nom_type(end),'a')||isequal(nom_type(end),'b')
31            str=char(96+num);
32        elseif isequal(nom_type(end),'A')|isequal(nom_type(end),'B')
33            str=char(64+num);
34        elseif isequal(nom_type,'series_i')|isequal(nom_type,'netc_series')...
35                |isequal(nom_type,'ima_num')| isequal(nom_type,'avi')| isequal(nom_type,'none')...
36                isequal(nom_type,'_i')|isequal(nom_type,'_i1-i2')
37            str='';
38        else
39            str=num2str(num);
40        end
41end
Note: See TracBrowser for help on using the repository browser.