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

Contents of /MITgcm_contrib/ecco_darwin/v4_llc270_JAMES_paper/matlab/myint2str.m

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


Revision 1.1 - (show annotations) (download)
Fri Feb 28 14:49:10 2020 UTC (5 years, 5 months ago) by dimitri
Branch: MAIN
CVS Tags: HEAD
first check-in of 3deg verification code for JAMES paper

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