Home > . > num2stra.m

num2stra

PURPOSE ^

'num2stra': transform number to the corresponding character string depending on the nomenclature

SYNOPSIS ^

function str=num2stra(num,nom_type,index);

DESCRIPTION ^

'num2stra': transform number to the corresponding character string depending on the nomenclature
--------------------------------------------
 function str=num2stra(num,nom_type)

 OUTPUT: 
 str: character string

 INPUT:
 num: input number (file index)
 nom_type: nomencalture type (see fct name_generator)

 see also: stra2num, name_generator, name2display

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %'num2stra': transform number to the corresponding character string depending on the nomenclature
0002 %--------------------------------------------
0003 % function str=num2stra(num,nom_type)
0004 %
0005 % OUTPUT:
0006 % str: character string
0007 %
0008 % INPUT:
0009 % num: input number (file index)
0010 % nom_type: nomencalture type (see fct name_generator)
0011 %
0012 % see also: stra2num, name_generator, name2display
0013 
0014 function str=num2stra(num,nom_type,index);
0015 if ~exist('index','var')
0016     index=2; %index 1 or 2 of the file indices
0017 end
0018 switch index
0019     case 1
0020         if length(nom_type)>=4 && isequal(nom_type(1:2),'%0') && isequal(nom_type(4),'d') 
0021            str=num2str(num,nom_type(1:4)); 
0022         else
0023            str=num2str(num); 
0024         end
0025     case 2
0026         if isempty(nom_type)
0027             nom_type='none';
0028         end
0029         if isequal(nom_type,'png_old') || isequal(nom_type,'netc_old') || isequal(nom_type,'raw_SMD')||...
0030             isequal(nom_type(end),'a')||isequal(nom_type(end),'b')
0031             str=char(96+num);
0032         elseif isequal(nom_type(end),'A')|isequal(nom_type(end),'B')
0033             str=char(64+num);
0034         elseif isequal(nom_type,'series_i')|isequal(nom_type,'netc_series')...
0035                 |isequal(nom_type,'ima_num')| isequal(nom_type,'avi')| isequal(nom_type,'none')...
0036                 isequal(nom_type,'_i')|isequal(nom_type,'_i1-i2')
0037             str='';
0038         else
0039             str=num2str(num);
0040         end
0041 end

Generated on Fri 13-Nov-2009 11:17:03 by m2html © 2003