octave-maintainers
[Top][All Lists]
Advanced

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

Re: Help with mixed numeric/char operations


From: John W. Eaton
Subject: Re: Help with mixed numeric/char operations
Date: Mon, 30 Jun 2014 16:33:18 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0

On 06/30/2014 04:24 PM, Серёжа Плотников wrote:
Matlab returns empty matrix as well:

 >> 'A' + 1:3
ans =
    Empty matrix: 1-by-0

/Be happy,/
/Sergey/


2014-06-30 22:22 GMT+02:00 Rik <address@hidden <mailto:address@hidden>>:

    All,

    Could someone test what Matlab does with

    'A' + 1:3

    Octave returns an empty matrix, but it might also be legitimate to
    return
    'BCD' or [66 67 68].

It returns an empty matrix because it is parsed as

  ('A' + 1) : 3

Try

  'A' + (1:3)

instead.

jwe




reply via email to

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