Mercurial > hg > octave-lyh
comparison scripts/general/num2str.m @ 7208:a730e47fda4d
[project @ 2007-11-28 02:32:41 by jwe]
author | jwe |
---|---|
date | Wed, 28 Nov 2007 02:32:42 +0000 |
parents | a1dbe9d80eee |
children | 83a8781b529d |
comparison
equal
deleted
inserted
replaced
7207:71c03c7239fb | 7208:a730e47fda4d |
---|---|
80 nd = ndims (x); | 80 nd = ndims (x); |
81 perm = fix ([1:0.5:nc+0.5]); | 81 perm = fix ([1:0.5:nc+0.5]); |
82 perm(2:2:2*nc) = perm(2:2:2*nc) + nc; | 82 perm(2:2:2*nc) = perm(2:2:2*nc) + nc; |
83 idx = cell (); | 83 idx = cell (); |
84 for i = 1:nd | 84 for i = 1:nd |
85 idx {i} = 1:sz(i); | 85 idx{i} = 1:sz(i); |
86 endfor | 86 endfor |
87 idx{2} = perm; | 87 idx{2} = perm; |
88 x = horzcat (real(x), imag(x)); | 88 x = horzcat (real (x), imag (x)); |
89 x = x(idx{:}); | 89 x = x(idx{:}); |
90 | 90 |
91 fmt = strcat (deblank (repmat (fmt, 1, nc)), "\n"); | 91 fmt = strcat (deblank (repmat (fmt, 1, nc)), "\n"); |
92 tmp = sprintf (fmt, permute (x, [2, 1, 3:nd])); | 92 tmp = sprintf (fmt, permute (x, [2, 1, 3:nd])); |
93 | 93 |