Path: news.mathworks.com!not-for-mail
From: "Dan Haeg" <haegd@msoe.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to round to 2 decimal?
Date: Tue, 4 Mar 2008 23:51:03 +0000 (UTC)
Organization: Milwaukee School of Engineering
Lines: 17
Message-ID: <fqkn97$hnn$1@fred.mathworks.com>
References: <fqjpma$66c$1@fred.mathworks.com>
Reply-To: "Dan Haeg" <haegd@msoe.edu>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1204674663 18167 172.30.248.35 (4 Mar 2008 23:51:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 4 Mar 2008 23:51:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 475291
Xref: news.mathworks.com comp.soft-sys.matlab:455404


"Deo " <spliers@hotmail.com> wrote in message
<fqjpma$66c$1@fred.mathworks.com>...
> hey, how can I set my matlab program to round all the 
> double numbers to 2 decimals

here is one way:

data=round(data*100)/100

rounding functions in matlab:

round
fix
floor
ceil

look in the help for more information.