source: trunk/src/num2stra.m @ 643

Last change on this file since 643 was 371, checked in by sommeria, 12 years ago

various bug fixes with file indexing. mode displacement from a fixed image introduced.
PIV stereo suppressed (todo: introduce in the GUI series).
find_file_series cleaned, with a change in the function arguments

File size: 1.0 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)
15str='';
16if ~exist('index','var')
17    index=2; %index 1 or 2 of the file indices
18end
19switch index
20    case 1
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
24           str=num2str(num);
25%         end
26    case 2
27        if ~isempty(nom_type) && (isequal(nom_type(end),'a')||isequal(nom_type(end),'b'))
28            str=char(96+num);
29        elseif ~isempty(nom_type) && (isequal(nom_type(end),'A')||isequal(nom_type(end),'B'))
30            str=char(64+num);
31        else
32            str=num2str(num);
33        end
34end
Note: See TracBrowser for help on using the repository browser.