/[MITgcm]/MITgcm_contrib/ecco_darwin/v4_3deg/matlab/myint2str.m
ViewVC logotype

Annotation of /MITgcm_contrib/ecco_darwin/v4_3deg/matlab/myint2str.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Mon Jan 27 02:52:07 2020 UTC (5 years, 6 months ago) by dimitri
Branch: MAIN
CVS Tags: HEAD
First complete check in with v4_llc270 ecco-darwin set-up

1 dimitri 1.1 function s=myint2str(x,n);
2     %MYIN2STR(X,N) convert integer to string with leading zeros
3     % padds integer X with zeros to N locations
4    
5     if nargin < 2, n=2; end
6     if nargin < 1, help myint2str, return, end
7    
8     %s=int2str(x);
9     %n=n-length(s);
10     %for i=1:n
11     % s=['0' s];
12     %end
13    
14     % replacement code contributed by M. Losch, November 28, 2008
15     fmt = sprintf('%%0%iu',n);
16     s=sprintf(fmt,x);

  ViewVC Help
Powered by ViewVC 1.1.22