From help-request at octave dot org Wed Dec 22 10:04:26 2004 Subject: Assigning to multiple scalars from a vector From: Neilen Marais To: help at octave dot org Date: Wed, 22 Dec 2004 18:20:14 +0200 Hi All. I'd like to be able to assign to several scalar variables from a vector in one shot. Say I have a vector like this : vec = [1 ; 2 ; 3] I would like to be able to do something like this: [A ; B ; C] = vec and get A = 1, B = 2, C = 3. Octave seems to consider the individual scalars as vectors, so there aren't enough elements on the RHS according to it. Is there a way to make this work, or will I have to manually say A = vec(1) etc... ? Thanks Neilen ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------