Mercurial > hg > octave-lojdl
changeset 8143:3a4694d67dbb
strcat.m: Compatibility of non-char data
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Wed, 24 Sep 2008 14:42:04 -0400 |
parents | 54b41376e381 |
children | 01fac748b680 |
files | scripts/ChangeLog scripts/strings/strcat.m |
diffstat | 2 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2008-09-24 Ben Abbott <bpabbott@mac.com> + + * strings/strcat.m: Improve Matlab compatibility for non-character + data. + 2008-09-24 John W. Eaton <jwe@octave.org> * general/interpft.m: Increase tolerance in tests.
--- a/scripts/strings/strcat.m +++ b/scripts/strings/strcat.m @@ -46,6 +46,10 @@ for nv = 1:nargin if (ischar (varargin{nv})) varargin{nv} = cellstr (varargin{nv}); + elseif (isreal (varargin{nv})) + varargin{nv} = cellstr (char (varargin{nv})); + elseif (isempty (varargin{nv})) + varargin{nv} = cellstr (''); elseif (iscell (varargin{nv})) allchar = false; else @@ -115,5 +119,7 @@ %!error strcat (); -%!error strcat (1, 2); +%!assert (strcat (1, 2), strcat (char(1), char(2))) +%!assert (strcat ('', 2), strcat ([], char(2))) +