help-octave
[Top][All Lists]
Advanced

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

variables `inheriting' values, rounding


From: Mike B.
Subject: variables `inheriting' values, rounding
Date: Mon, 25 Jan 2010 22:08:20 -0800 (PST)

Thanks for replying.

As an example. I have a structure A which is defined in the begining of the code but it should actually inherit values from another structure defined later, something like
algorithm_parameters = settings;
.
.
.
settings = [ 0, 0.4 ];

Also, is there a function to round real numbers to a certain accuracy (digits after the decimal) so they are also stored rounded (not just displayed rounded), something like:
round( 1.1217, 3 ) gives 1.122 etc.

Thanks.

--- On Tue, 26/1/10, John W. Eaton <address@hidden> wrote:

From: John W. Eaton <address@hidden>
Subject: Re: variables `inheriting' values
To: address@hidden
Cc: "Jordi Gutiérrez Hermoso" <address@hidden>, "Octave mai. lis." <address@hidden>
Date: Tuesday, 26 January, 2010, 3:43 PM

On 25-Jan-2010, Mike B. wrote:

| Hi Jordi.
|
| Thanks for replying.
| I was thinking more like a symlink to variables (similarly to a symlink between files in linux), so something like:
| symlink( a, b )  # symlink b to a, not sure if this exists
| a = 1
|
| so now b (automatically) equals 1 as well.
| This ideally would also work even if `a' is still undefined, so I can fill-in values later, for example:
| clear -a
| symlink( a,b )
| a = 1
|
| Is this possible?.

It sounds like you want references (or perhaps pointers) and Octave
does not have either.  Can you explain why do you want this feature
with a nontrivial example?

jwe


Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com.
reply via email to

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