Mercurial > hg > octave-lyh
annotate doc/interpreter/sparseimages.m @ 11033:d9c8916bb9dd
Untabify a few remaining .m scripts.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Tue, 28 Sep 2010 13:24:21 -0700 |
parents | e76d8c767584 |
children | 4cbb08163a1f |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 2006, 2007, 2008 David Bateman |
7018 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
6126 | 19 function sparseimages (nm, typ) |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
20 set_print_size (); |
7257 | 21 if (strcmp (typ, "png")) |
22 set (0, "defaulttextfontname", "*"); | |
23 endif | |
9914
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
24 |
6040 | 25 if (! isempty (findstr (octave_config_info ("DEFS"), "HAVE_COLAMD")) |
26 && ! isempty (findstr (octave_config_info ("DEFS"), "HAVE_CHOLMOD")) | |
27 && ! isempty (findstr (octave_config_info ("DEFS"), "HAVE_UMFPACK"))) | |
6126 | 28 if (strcmp(typ,"txt")) |
29 txtimages (nm, 15, typ); | |
6003 | 30 else |
6126 | 31 if (strcmp (nm, "gplot")) |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
32 gplotimages ("gplot", typ); |
6126 | 33 elseif (strcmp (nm, "grid")) |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
34 femimages ("grid", typ); |
6126 | 35 else |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
36 otherimages (nm, 200, typ); |
6126 | 37 endif |
6003 | 38 endif |
6040 | 39 else ## There is no sparse matrix implementation available because |
40 ## of missing libraries, plot sombreros instead | |
41 sombreroimage (nm, typ); | |
42 endif | |
6003 | 43 endfunction |
44 | |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
45 function set_print_size () |
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
46 image_size = [5.0, 3.5]; # in inches, 16:9 format |
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
47 border = 0; # For postscript use 50/72 |
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
48 set (0, "defaultfigurepapertype", "<custom>"); |
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
49 set (0, "defaultfigurepaperorientation", "landscape"); |
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
50 set (0, "defaultfigurepapersize", image_size + 2*border); |
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
51 set (0, "defaultfigurepaperposition", [border, border, image_size]); |
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
52 endfunction |
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
53 |
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
54 function hide_output () |
6257 | 55 f = figure (1); |
56 set (f, "visible", "off"); | |
6003 | 57 endfunction |
58 | |
6040 | 59 function gplotimages (nm, typ) |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
60 hide_output (); |
9914
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
61 if (strcmp (typ, "eps")) |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
62 d_typ = "-depsc2"; |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
63 else |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
64 d_typ = cstrcat ("-d", typ); |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
65 endif |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
66 |
6040 | 67 A = sparse ([2,6,1,3,2,4,3,5,4,6,1,5], |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
68 [1,1,2,2,3,3,4,4,5,5,6,6], 1, 6, 6); |
6003 | 69 xy = [0,4,8,6,4,2;5,0,5,7,5,7]'; |
6040 | 70 gplot (A, xy) |
9914
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
71 print (cstrcat (nm, ".", typ), d_typ) |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
72 hide_output (); |
6003 | 73 endfunction |
74 | |
75 function txtimages(nm,n,typ) | |
76 a = 10*speye(n) + sparse(1:n,ceil([1:n]/2),1,n,n) + ... | |
77 sparse(ceil([1:n]/2),1:n,1,n,n); | |
78 if (strcmp (nm, "gplot") || strcmp (nm, "grid")) | |
79 fid = fopen (sprintf ("%s.txt", nm), "wt"); | |
7256 | 80 fputs (fid, "\n"); |
6003 | 81 fputs (fid, "+---------------------------------+\n"); |
82 fputs (fid, "| Image unavailable in text mode. |\n"); | |
83 fputs (fid, "+---------------------------------+\n"); | |
84 fclose (fid); | |
85 elseif (strcmp (nm, "spmatrix")) | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7262
diff
changeset
|
86 printsparse(a,cstrcat("spmatrix.",typ)); |
6003 | 87 else |
88 if (!isempty(findstr(octave_config_info ("DEFS"),"HAVE_COLAMD")) && | |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
89 !isempty(findstr(octave_config_info ("DEFS"),"HAVE_CHOLMOD"))) |
6003 | 90 if (strcmp (nm, "spchol")) |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
91 r1 = chol(a); |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
92 printsparse(r1,cstrcat("spchol.",typ)); |
6003 | 93 elseif (strcmp (nm, "spcholperm")) |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
94 [r2,p2,q2]=chol(a); |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
95 printsparse(r2,cstrcat("spcholperm.",typ)); |
6003 | 96 endif |
97 ## printf("Text NNZ: Matrix %d, Chol %d, PermChol %d\n",nnz(a),nnz(r1),nnz(r2)); | |
98 endif | |
99 endif | |
100 endfunction | |
101 | |
102 function otherimages(nm,n,typ) | |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
103 hide_output (); |
9914
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
104 if (strcmp (typ, "eps")) |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
105 d_typ = "-depsc2"; |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
106 else |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
107 d_typ = cstrcat ("-d", typ); |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
108 endif |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
109 |
6003 | 110 a = 10*speye(n) + sparse(1:n,ceil([1:n]/2),1,n,n) + ... |
111 sparse(ceil([1:n]/2),1:n,1,n,n); | |
112 if (strcmp (nm, "spmatrix")) | |
113 spy(a); | |
114 axis("ij") | |
9914
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
115 print(cstrcat("spmatrix.",typ), d_typ) |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
116 hide_output (); |
6003 | 117 else |
118 if (!isempty(findstr(octave_config_info ("DEFS"),"HAVE_COLAMD")) && | |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
119 !isempty(findstr(octave_config_info ("DEFS"),"HAVE_CHOLMOD"))) |
6003 | 120 if (strcmp (nm, "spchol")) |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
121 r1 = chol(a); |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
122 spy(r1); |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
123 axis("ij") |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
124 print(cstrcat("spchol.",typ), d_typ) |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
125 hide_output (); |
6003 | 126 elseif (strcmp (nm, "spcholperm")) |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
127 [r2,p2,q2]=chol(a); |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
128 spy(r2); |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
129 axis("ij") |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
130 print(cstrcat("spcholperm.",typ), d_typ) |
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
131 hide_output (); |
6003 | 132 endif |
133 ## printf("Image NNZ: Matrix %d, Chol %d, PermChol %d\n",nnz(a),nnz(r1),nnz(r2)); | |
134 endif | |
135 endif | |
136 endfunction | |
137 | |
138 function printsparse(a,nm) | |
139 fid = fopen (nm,"wt"); | |
7256 | 140 fputs (fid, "\n"); |
6003 | 141 for i = 1:size(a,1) |
142 if (rem(i,5) == 0) | |
143 fprintf (fid," %2d - ", i); | |
144 else | |
145 fprintf (fid," | "); | |
146 endif | |
147 for j = 1:size(a,2) | |
148 if (a(i,j) == 0) | |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
149 fprintf(fid," ") |
6003 | 150 else |
11033
d9c8916bb9dd
Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents:
9914
diff
changeset
|
151 fprintf(fid," *") |
6003 | 152 endif |
153 endfor | |
154 fprintf(fid,"\n") | |
155 endfor | |
156 fprintf(fid," |-"); | |
157 for j=1:size(a,2) | |
158 if (rem(j,5)==0) | |
159 fprintf(fid,"-|"); | |
160 else | |
161 fprintf(fid,"--"); | |
162 endif | |
163 endfor | |
164 fprintf(fid,"\n") | |
165 fprintf(fid," "); | |
166 for j=1:size(a,2) | |
167 if (rem(j,5)==0) | |
168 fprintf(fid,"%2d",j); | |
169 else | |
170 fprintf(fid," "); | |
171 endif | |
172 endfor | |
173 fclose(fid); | |
174 endfunction | |
175 | |
176 function femimages (nm,typ) | |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
177 hide_output (); |
9914
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
178 if (strcmp (typ, "eps")) |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
179 d_typ = "-depsc2"; |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
180 else |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
181 d_typ = cstrcat ("-d", typ); |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
182 endif |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
183 |
6003 | 184 if (!isempty(findstr(octave_config_info ("DEFS"),"HAVE_COLAMD")) && |
185 !isempty(findstr(octave_config_info ("DEFS"),"HAVE_CHOLMOD")) && | |
186 !isempty(findstr(octave_config_info ("DEFS"),"HAVE_UMFPACK"))) | |
187 ## build a rectangle | |
188 node_y = [1;1.2;1.5;1.8;2]*ones(1,11); | |
189 node_x = ones(5,1)*[1,1.05,1.1,1.2,1.3,1.5,1.7,1.8,1.9,1.95,2]; | |
190 nodes = [node_x(:), node_y(:)]; | |
191 | |
192 [h,w] = size(node_x); | |
193 elems = []; | |
194 for idx = 1:w-1 | |
195 widx = (idx-1)*h; | |
196 elems = [elems; widx+[(1:h-1);(2:h);h+(1:h-1)]']; | |
197 elems = [elems; widx+[(2:h);h+(2:h);h+(1:h-1)]']; | |
198 endfor | |
199 | |
200 E = size(elems,1); #No. of elements | |
201 N = size(nodes,1); #No. of elements | |
202 D = size(elems,2); #dimentions+1 | |
203 | |
204 ## Plot FEM Geometry | |
205 elemx = elems(:,[1,2,3,1])'; | |
206 xelems = reshape( nodes(elemx, 1), 4, E); | |
207 yelems = reshape( nodes(elemx, 2), 4, E); | |
208 | |
209 ## Set element conductivity | |
210 conductivity = [1*ones(1,16),2*ones(1,48),1*ones(1,16)]; | |
211 | |
212 ## Dirichlet boundary conditions | |
213 D_nodes = [1:5, 51:55]; | |
214 D_value = [10*ones(1,5), 20*ones(1,5)]; | |
215 | |
216 ## Neumann boundary conditions | |
217 ## Note that N_value must be normalized by the boundary | |
218 ## length and element conductivity | |
219 N_nodes = []; | |
220 N_value = []; | |
221 | |
222 ## Calculate connectivity matrix | |
223 C = sparse((1:D*E), reshape(elems',D*E,1),1, D*E, N); | |
224 | |
225 ## Calculate stiffness matrix | |
226 Siidx = floor([0:D*E-1]'/D)*D*ones(1,D) + ones(D*E,1)*(1:D) ; | |
227 Sjidx = [1:D*E]'*ones(1,D); | |
228 Sdata = zeros(D*E,D); | |
229 dfact = prod(2:(D-1)); | |
230 for j = 1:E | |
231 a = inv([ ones(D,1), nodes( elems(j,:), : ) ]); | |
232 const = conductivity(j)*2/dfact/abs(det(a)); | |
233 Sdata(D*(j-1)+(1:D),:)= const * a(2:D,:)'*a(2:D,:); | |
234 endfor | |
235 | |
236 ## Element-wise system matrix | |
237 SE = sparse(Siidx,Sjidx,Sdata); | |
238 ## Global system matrix | |
239 S = C'* SE *C; | |
240 | |
241 ## Set Dirichlet boundary | |
242 V = zeros(N,1); | |
243 V(D_nodes) = D_value; | |
244 idx = 1:N; | |
245 idx(D_nodes) = []; | |
246 | |
247 ## Set Neumann boundary | |
248 Q = zeros(N,1); | |
249 Q(N_nodes) = N_value; # FIXME | |
250 | |
251 V(idx) = S(idx,idx)\( Q(idx) - S(idx,D_nodes)*V(D_nodes) ); | |
252 | |
253 velems = reshape( V(elemx), 4, E); | |
254 | |
255 sz = size(xelems,2); | |
6178 | 256 |
257 plot3 (xelems, yelems, velems); | |
6257 | 258 view (10, 10); |
9914
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
259 print(cstrcat(nm,".",typ), d_typ) |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
260 hide_output (); |
6003 | 261 endif |
262 endfunction | |
6040 | 263 |
264 ## There is no sparse matrix implementation available because of missing | |
265 ## libraries, plot sombreros instead. Also plot a nice title that we are | |
266 ## sorry about that. | |
267 function sombreroimage (nm, typ) | |
268 if (strcmp (typ, "txt")) | |
269 fid = fopen (sprintf ("%s.txt", nm), "wt"); | |
7256 | 270 fputs (fid, "\n"); |
6040 | 271 fputs (fid, "+---------------------------------------+\n"); |
272 fputs (fid, "| Image unavailable because of a |\n"); | |
273 fputs (fid, "| missing sparse matrix implementation. |\n"); | |
274 fputs (fid, "+---------------------------------------+\n"); | |
275 fclose (fid); | |
276 return; | |
277 else ## if (!strcmp (typ, "txt")) | |
278 | |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
279 hide_output (); |
9914
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
280 if (strcmp (typ, "eps")) |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
281 d_typ = "-depsc2"; |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
282 else |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
283 d_typ = cstrcat ("-d", typ); |
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
284 endif |
6040 | 285 |
286 x = y = linspace (-8, 8, 41)'; | |
287 [xx, yy] = meshgrid (x, y); | |
288 r = sqrt (xx .^ 2 + yy .^ 2) + eps; | |
289 z = sin (r) ./ r; | |
290 unwind_protect | |
6257 | 291 mesh (x, y, z); |
292 title ("Sorry, graphics not available because octave was\\ncompiled without the sparse matrix implementation."); | |
6040 | 293 unwind_protect_cleanup |
9914
e76d8c767584
Switch to color output for PostScript documentation images
Rik <rdrider0-list@yahoo.com>
parents:
9912
diff
changeset
|
294 print (cstrcat (nm, ".", typ), d_typ); |
9912
e9fe12c1b0c0
Set default papersize to the desired imagesize
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
295 hide_output (); |
6040 | 296 end_unwind_protect |
297 endif | |
298 endfunction | |
7262 | 299 |
300 ## generate something for the texinfo @image command to process | |
301 function image_as_txt(nm) | |
302 fid = fopen (sprintf ("%s.txt", nm), "wt"); | |
303 fputs (fid, "\n"); | |
304 fputs (fid, "+---------------------------------+\n"); | |
305 fputs (fid, "| Image unavailable in text mode. |\n"); | |
306 fputs (fid, "+---------------------------------+\n"); | |
307 fclose (fid); | |
308 endfunction |