[Top][All Lists]

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

Re: extracting value from a vector

From: James Sherman Jr.
Subject: Re: extracting value from a vector
Date: Tue, 21 Apr 2009 11:02:15 -0400

Yes.  I may miss the subtleties, but the only way I've seen the assignment

[a,b,c] = <something>

work is when <something> is a function and that it returns 3 different variables.

On Tue, Apr 21, 2009 at 10:44 AM, Alain Baeckeroot <address@hidden> wrote:

A trivial question, but i don't find the answer in the doc.
i would like to assign value of a vector individually to some variables.
 octave> v = [ 1.4 , 2.7, 3.1 ]

This fails : octave> [ a, b, c ] = v;
everything goes in 'a', and b is undefined.

Is it necessary to write a = v(1); b = v(2) ...
or did i missed something ?


Help-octave mailing list

reply via email to

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