help-octave
[Top][All Lists]
Advanced

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

Re: variables `inheriting' values, rounding


From: Mike B.
Subject: Re: variables `inheriting' values, rounding
Date: Tue, 26 Jan 2010 17:16:09 -0800 (PST)

Sorry for the HTML email-I've now selected `plain text' in yahoo mail so hope 
this helps.

I'll look into your suggestions regarding settings parameter as a function.

I'm familiar with round, but was wondering if there is a already a pre-defined 
`round' function which accepts the accuracy as a parameter. 

Cheers.

--- On Wed, 27/1/10, Jordi Gutiérrez Hermoso <address@hidden> wrote:

> From: Jordi Gutiérrez Hermoso <address@hidden>
> Subject: Re: variables `inheriting' values, rounding
> To: address@hidden
> Cc: "John W. Eaton" <address@hidden>, "Octave mai. lis." <address@hidden>
> Date: Wednesday, 27 January, 2010, 2:34 AM
> Mike, although there isn't an
> official policy on this mailing list,
> I'd like to encourage you to not top-post and avoid HTML
> emails if
> possible. It's an old email convention many of us still
> like.
> 
> 2010/1/26 Mike B. <address@hidden>
> > 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 ];
> 
> My earlier suggestion to make settings a function that
> returns the
> actual values you want might work here, assuming that the
> overhead of
> a function call isn't a problem in your algorithm.
> 
> Barring that, Octave can do functional programming rather
> well, so I
> would structure your code so that your algorithm is
> contained in a
> function and settings is a parameter to that function.
> 
> > Also, is there a function to round real numbers to a
> certain
> > accuracy
> 
> If you go to http://octave.sourceforge.net, click on
> function
> reference at the top and then look at the alphabetical
> list, you will
> find that round is a built-in function that rounds to the
> nearest
> integer. You can easily use this to round to whatever
> decimal place
> you want.
> 
> HTH,
> - Jordi G. H.
> 


      Get your new Email address!
Grab the Email name you&#39;ve always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/



reply via email to

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