[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Update an array
From: |
afullo |
Subject: |
Update an array |
Date: |
Fri, 29 Aug 2014 13:11:38 -0700 (PDT) |
Is there a way to update an array depending on some variables, when these
variables are changed?
For example, I was thinking whether is possible to obtain something like
that:
a = 1;
A = [1 a a^2];
A
A =
1 1 1
a = 2;
*update* A;
A
A =
1 2 4
In this case it could seem not of much interest (why to use a new command,
while it is sufficient to repeat A = [1 a a^2] ?), but in fact it could be
useful when the definition of A is more complicated (for example, it could
involve more than one variabile, or it could be piecewise).
Thanks in advance.
--
View this message in context:
http://octave.1599824.n4.nabble.com/Update-an-array-tp4666280.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Update an array,
afullo <=