octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Matlab weirdness


From: John W. Eaton
Subject: Matlab weirdness
Date: Mon, 10 Jan 2011 15:40:21 -0500

On  9-Jan-2011, Ben Abbott wrote:

| Has this unexpected behavior been discussed before.
| 
| 
| >> a = ['a', 'b', {}]
| 
| a =     'a'    'b'
| 
| >> whos a
|   Name      Size            Bytes  Class    Attributes
|   a         1x2               228  cell  
| 
| Apparently, Matlab does an implicit conversion to cell strings.
| 
| I assume we don't want to copy this, but I thought I'd ask.

I don't recall discussing this, but that doesn't mean much these
days...

I would not want to insert a special case just for this, and from this
one example, I have no idea what the general rule should be.

Is it documente somewhere?

I guess the implementation can't be

  horzcat (horzcat ('a', 'b'), {})

because then 'a' and 'b' would not appear as separate elements.

Are there constraints on the order?  What about

  [{}, 'a', 'b']
  ['a', {}, 'b']

(I assume these work).

Is this behavior limited to strings+cells?  What about

  ['a', '1', {1,2}]

  s.a = 1
  [s, 'a', {1,2}]
  ['a', s, {1,2}]
  ['a', {1,2}, s]

etc.  I have no idea what to expect for these.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]