11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.6 1998/07/27 18:59:11 peterg
# %% Added WMIN etc
# %%
# %% Revision 1.5 1998/07/26 11:54:20 peterg
# %% Added mtt to variables
# %%
# %% Revision 1.4 1998/07/26 09:50:12 peterg
|
>
>
>
>
>
>
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.7 1998/07/30 09:32:33 peterg
# %% Replaces:
# %% euler by 1
# %% implicitl by 1
# %% implicit by 3
# %%
# %% Revision 1.6 1998/07/27 18:59:11 peterg
# %% Added WMIN etc
# %%
# %% Revision 1.5 1998/07/26 11:54:20 peterg
# %% Added mtt to variables
# %%
# %% Revision 1.4 1998/07/26 09:50:12 peterg
|
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
echo '% Dummy globals' >> $1_$2.m
echo 'global ...' >> $1_$2.m
echo 'mtt_dummy_global;' >> $1_$2.m
fi
#Write out the variables in m format.
awk -F# '{
N=split($1,a,"=");
if (N==2) {
LHS = a[1];
RHS = tolower(a[2]);
sub(/"*euler"*/, 1, RHS);
sub(/"*implicitl"*/, 2, RHS);
sub(/"*implicit"*/, 3, RHS);
statement = sprintf("%s=%s",LHS,RHS);
}
else
statement = $1;
if (NF<2) print statement
if (NF>1) print statement " # " $2
}' $1_$2.txt | sed\
-e 's/\[\([0-9]*\)\]/(\1)/g' \
-e 's/\([^a-zA-Z]\)t\([^a-zA-Z]\)/\1mttt\2/g' \
-e 's/LAST/mttLAST/g' \
-e 's/DT/mttDT/g' \
-e 's/STEPFACTOR/mttSTEPFACTOR/g' \
-e 's/METHOD/mttMETHOD/g' \
-e 's/WMIN/mttWMIN/g' \
-e 's/WMAX/mttWMAX/g' \
-e 's/WSTEPS/mttWSTEPS/g' \
-e 's/x(/mttx(/g' \
-e 's/u(/mttu(/g' \
-e 's/mttmtt/mtt/g' \
#>> $1_$2m
|
>
|
>
>
>
>
>
|
|
|
>
>
|
<
|
|
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
echo '% Dummy globals' >> $1_$2.m
echo 'global ...' >> $1_$2.m
echo 'mtt_dummy_global;' >> $1_$2.m
fi
#Write out the variables in m format.
cat $1_$2.txt |\
awk -F# 'BEGIN{
quote = "\047";
doublequote = "\042";
}
{
N=split($1,a,"=");
if (N==2) {
LHS = a[1];
RHS = tolower(a[2]);
gsub(quote, doublequote, RHS);
sub(/["]*euler["]*/, 1, RHS);
sub(/["]*implicitl["]*/, 2, RHS);
sub(/["]*implicit["]*/, 3, RHS);
statement = sprintf("%s=%s",LHS,RHS);
if (match(statement,";")==0)
statement = sprintf("%s;", statement);
}
else
statement = $1;
if (NF<2) print statement
if (NF>1) print statement " # " $2
}' | sed\
-e 's/\[\([0-9]*\)\]/(\1)/g' \
-e 's/\([^a-zA-Z]\)t\([^a-zA-Z]\)/\1mttt\2/g' \
-e 's/LAST/mttLAST/g' \
-e 's/DT/mttDT/g' \
-e 's/STEPFACTOR/mttSTEPFACTOR/g' \
-e 's/METHOD/mttMETHOD/g' \
-e 's/WMIN/mttWMIN/g' \
-e 's/WMAX/mttWMAX/g' \
-e 's/WSTEPS/mttWSTEPS/g' \
-e 's/x(/mttx(/g' \
-e 's/u(/mttu(/g' \
-e 's/mttmtt/mtt/g' \
>> $1_$2.m
|