help-octave
[Top][All Lists]
Advanced

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

Re: Rounding intergers


From: Philip Nienhuis
Subject: Re: Rounding intergers
Date: Mon, 26 Jan 2015 14:13:06 -0800 (PST)

Fern wrote
> Hi all,
> 
> I´ve been trying to round a matrix like this:
> 
> 99  187  234  67
> 
> 88  123   94  212
> 
> and I expect to have an output matrix like this:
> 
> 100  190  230  70
> 
> 90    120   90  210
> 
> I have tried the function round(x), ceil(x), floor(x) and fix(x), but
> aparently they only round a decimal number to the next integer.
> 
> I´ve looked up on the posts but couldn´t find the answer for this.

Easiest is first divide by 10, round, multiply with 10.

P.



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Rounding-intergers-tp4668274p4668280.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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