help-octave
[Top][All Lists]
Advanced

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

Re: inconsitency in behavior of 'size'


From: Nicholas Jankowski
Subject: Re: inconsitency in behavior of 'size'
Date: Mon, 12 Mar 2018 16:59:34 -0400



On Mon, Mar 12, 2018 at 12:57 PM, Przemek Klosowski <address@hidden> wrote:
On 03/10/2018 07:21 PM, Sergei Steshenko wrote:
"The syntax for slicing values out of a comma-separated list looks a lot like matrix concatenation" - which is obfuscation.

I.e. [foo, bar] should always mean the same. The situation is really bad - see copy-paste of a session:


...

another example that highlights one of Mike's explanations:


---------------
>> fzero(@sin, 1)
ans = 0

>> [a,b] = fzero(@sin,1)
a = 0
b = 0

>> [a,b,c,d] = fzero(@sin,1)
a = 0
b = 0
c =  1
d =

  scalar structure containing the fields:

    iterations = 0
    funcCount =  4
    bracketx =

       0    0

    brackety =

       0    0
------------------------

quite obviously, [] as a multi-element list assignment operator cannot require that it form a valid matrix, as the return values don't even have to be the same type, yet alone the same size.

reply via email to

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