From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Rounding decimals off in multiple columns
Date: Thu, 3 Jan 2013 21:37:08 +0000 (UTC)
Organization: Bogazici
Lines: 30
Message-ID: <kc4tm4$78b$>
References: <gjarn1$87n$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1357249028 7435 (3 Jan 2013 21:37:08 GMT)
NNTP-Posting-Date: Thu, 3 Jan 2013 21:37:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3951820
Xref: comp.soft-sys.matlab:785899

"Ryan Neilson" <> wrote in message <gjarn1$87n$>...
> Hello:
> I'm trying to round-off data in columns to three decimals and was hoping for some useful assistance!
> In the array, I need to round 5 columns (columns #4-8) to three decimals places. There are 1,099 rows in these columns if that's helpful/useful whatsoever.
> Thanks in advance!

Thanks to everyone who is sharing lots of useful information in here. Just did lots of logging issue to be able to share this simple "excel trick": Want to cut of all unnecessary part of 0.1111111111111 just take mod in decimal precision I need 0.1 ,0.01 or 0.001.

Then subtract it from the number it self... Here you are

>> mod(0.111111111,0.01)

ans =


>> mod(0.111111111,0.001)

ans =


>> 0.111111111-ans

ans =