extracting value from a vector
James Sherman Jr.
shermanj at umd.edu
Tue Apr 21 10:02:15 CDT 2009
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 <
alain.baeckeroot at laposte.net> wrote:
> 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
>
> _______________________________________________
> Help-octave mailing list
> Help-octave at octave.org
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090421/5aba14a3/attachment.html
More information about the Help-octave
mailing list