[Top][All Lists]

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

append numbers to variable

From: the_verge
Subject: append numbers to variable
Date: Wed, 6 Sep 2006 17:25:37 -0700 (PDT)

I have a question related to my last one, but it's slightly different:

What I would like to do is, in a for loop, create a new variable with the
current index of the loop appended.  For example:

for i=1:5
x[append number i] = x+i;

It should output the following:
x1 = 1
x2 = 2
x3 = 3
x4 = 4
x5 = 5

So the for loop should have created 5 new variables and assigned them

Any ideas?

View this message in context:
Sent from the Octave - General forum at

reply via email to

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