From bug-octave-request at bevo dot che dot wisc dot edu Fri Jul 21 21:04:12 2000 Subject: Re: str2mat does not accept [] From: "John W. Eaton" To: pkienzle at kienzle dot powernet dot co dot uk (Paul Kienzle) Cc: bug-octave at bevo dot che dot wisc dot edu Date: Fri, 21 Jul 2000 21:04:24 -0500 (CDT) On 21-Jul-2000, Paul Kienzle wrote: | Okay, matlab accepts both [] and '', and treats them as equivalent. | Actually, matlab's str2mat seems to have an implicit setstr on all | its arguments: | | >> str2mat(65,'B') | ans = | A | B I've modified str2mat so that it applies setstr to each non-string argument. It is very unlikely that Octave will change so that [] and "" are actually equivalent. One is an empty (real) matrix and the other is an empty strings. The objects have different types, so they are not the same. If you want an empty string, say so by writing "" (or ''), not []. | Unfortunately, this means that in either case my code example won't | work: I will end up with a blank string at the head of my list of | strings. The solution is a new function, strvcat, which in matlab | does vertical concatenation but ignores empty matrices. I'll repost | patches shortly. I think str2mat is fixed now. Can you modify the current CVS version of str2mat to make it behave the way strvcat should? Thanks, jwe ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------