comparison scripts/general/num2str.m @ 8886:0c1a9c178fdd

replace last call to split with strsplit
author John W. Eaton <jwe@octave.org>
date Fri, 27 Feb 2009 12:56:31 -0500
parents 2c8b2399247b
children 937b58380b6a
comparison
equal deleted inserted replaced
8885:47fb59095191 8886:0c1a9c178fdd
174 endif 174 endif
175 fmt = cstrcat (deblank (repmat (fmt, 1, columns (x))), "\n"); 175 fmt = cstrcat (deblank (repmat (fmt, 1, columns (x))), "\n");
176 nd = ndims (x); 176 nd = ndims (x);
177 tmp = sprintf (fmt, permute (x, [2, 1, 3:nd])); 177 tmp = sprintf (fmt, permute (x, [2, 1, 3:nd]));
178 tmp(length (tmp)) = ""; 178 tmp(length (tmp)) = "";
179 retval = strtrim (split (tmp, "\n")); 179 retval = strtrim (strsplit (tmp, "\n"));
180 endif 180 endif
181 181
182 endfunction 182 endfunction
183 183
184 %!assert ((strcmp (num2str (123), "123") && strcmp (num2str (1.23), "1.23"))); 184 %!assert ((strcmp (num2str (123), "123") && strcmp (num2str (1.23), "1.23")));