help-octave
[Top][All Lists]
Advanced

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

Re: Update an array


From: Markus Bergholz
Subject: Re: Update an array
Date: Sat, 30 Aug 2014 07:52:32 +0200




On Fri, Aug 29, 2014 at 10:11 PM, afullo <address@hidden> wrote:
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


afaik, there is no "auto-update".
 
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).

then simply put all your complicated code to calculate A into a function ;)

 

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.

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave



--
icq: 167498924
XMPP|Jabber: address@hidden

reply via email to

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