extracting value from a vector

Alain Baeckeroot alain.baeckeroot at laposte.net
Tue Apr 21 09:44:21 CDT 2009


Hi

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 ?

Alain



More information about the Help-octave mailing list