Differences From Artifact [07b58f747a]:
- File mttroot/mtt/lib/control/PPP/ppp_ustar2h.m — part of check-in [358cf70240] at 2003-08-19 16:19:53 on branch origin/master — Covenverst U* to a c-header file (user: gawthrop@users.sourceforge.net, size: 810) [annotate] [blame] [check-ins using] [more...]
To Artifact [ec1d4f0005]:
- File mttroot/mtt/lib/control/PPP/ppp_ustar2h.m — part of check-in [a6be83f057] at 2005-09-07 18:30:36 on branch origin/master — Updated for new PPP (user: gawthrop@users.sourceforge.net, size: 917) [annotate] [blame] [check-ins using] [more...]
|
| | > > > > | > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | function ppp_ustar2h (Ustar,DT,name) ## usage: ppp_Ustar2h (Ustar[,name]) ## ## if nargin<2 DT = 1; endif if nargin<3 name = "Ustar"; endif [N,N_U] = size(Ustar); ## Open the file filename = sprintf("%s.h", name); fid = fopen(filename,"w"); ## 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 = ","; |
︙ | ︙ |