help-octave
[Top][All Lists]
Advanced

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

Re: cs-lists and multiple return arguments


From: Przemek Klosowski
Subject: Re: cs-lists and multiple return arguments
Date: Fri, 28 Oct 2011 14:45:14 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 10/28/2011 02:26 PM, Jordi Gutiérrez Hermoso wrote:
I don't understand why this works:

     [a,b] = {1, 2}{:}

but this doesn't

     [a,b] = 1,2

1,2 is two statements; statement '2' doesn't do much while '1' tries to supply both results ('a' and 'b'), and fails.

[a,b] = deal(1,2) works fine---that's what 'deal()' was intended for.


reply via email to

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