ADDED mttroot/mtt/bin/trans/m/str2ch.m Index: mttroot/mtt/bin/trans/m/str2ch.m ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/m/str2ch.m @@ -0,0 +1,42 @@ +function ch = str2ch(str,n) +% str2ch - pulls the nth char from a string +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function str2ch.m +% ch = str2ch(str,n) +% Copyright (c) P.J. Gawthrop, 1996. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +implicit_str_to_num_ok = "true"; +str = abs(str); + +if (n>0) & (n<=length(str)) + ch = setstr(str(n)); +else + ch = ''; +end; + + + + + + + + + + + + + + +