20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
## Header
header = sprintf("/*\n File %s generated by ppp_ustar2h on %s */\n", \
filename, ctime(time));
def = sprintf("#define N_U %i\n#define N_T %i\n#define DT %g\n", \
N_U, N, DT);
def = sprintf("%sdouble U[N_U];\n",def);
fprintf(fid, "%s%sdouble %s[N_T][N_U] = {\n",header,def,name);
for i=1:N
fprintf(fid, "{");
for j=1:N_U
if j<N_U
comma = ",";
|
|
>
>
>
>
>
>
>
>
>
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
## Header
header = sprintf("/*\n File %s generated by ppp_ustar2h on %s */\n", \
filename, ctime(time));
def = sprintf("#define N_U %i\n#define N_T %i\n#define DT %g\n", \
N_U, N, DT);
def = sprintf("%sdouble U[N_U]={",def);
for j=1:N_U
if j<N_U
comma = ",";
else
comma = "";
endif
def = sprintf("%s0.0%s ",def, comma);
endfor
def = sprintf("%s};\n",def)
fprintf(fid, "%s%sdouble %s[N_T][N_U] = {\n",header,def,name);
for i=1:N
fprintf(fid, "{");
for j=1:N_U
if j<N_U
comma = ",";
|