Code covered by the BSD License  

Highlights from
roundoff

4.4375

4.4 | 16 ratings Rate this file 14 Downloads (last 30 days) File Size: 1.2 KB File ID: #1374

roundoff

by Glenn Gomes

 

20 Feb 2002

Rounds a number (scalar, matrix or vector) to a specified number of decimal places

| Watch this File

File Information
Description

Rounds a scalar, vector or matrix to a specified number of decimal places.

Syntax roundoff(number,decimal_places)

MATLAB release MATLAB 5.3 (R11)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (19)
02 May 2002 Perre

Thanks for this function.It have been very useful for me because of my problems about aproximation and rounding in Matlab.
Thanks for your time.

06 Apr 2004 Andrew Leung

thanks !!!

05 May 2004 Rita Chawla  
08 Nov 2004 ko me

it does not work
roundoff(7.8866655, 6)
>7.8867

19 May 2005 Nthabiseng Ntene

The function is very helpful and it works.. Thanks

31 May 2005 Elena Ranguelova

It does work. Long numerical display format must be set for the workspace to see more t han 4 decimal places.

roundoff(7.8866655, 6)

ans =

   7.88666600000000

12 Aug 2005 D. L.

Clever and useful snippet.

08 Jun 2006 Barry Shaw

Excellent. Thank you.

13 Oct 2006 Mayank Chadha

useful little program.

12 Feb 2007 Mak mak

Thanking you, simple and useful function.
http://www.geocities.com/mak2000sw/

19 Jun 2007 Steve M

Thanks so much. Saved me the trouble of writing one!

31 Aug 2007 Mike Ming

Good. But how to display the result of
y = roundoff(pi,64)

12 Mar 2008 Chen Lim Toh

Excellent! Just what I am looking for. great help to a newbie like me, 1 day experience with MatLab

27 Mar 2008 Milton Quinteros

It is really simple, but powerfull...Thanks so much

23 Apr 2010 marty

Good function... Simple and useful.. thanks

02 Jun 2010 Didi Cvet  
14 Dec 2010 Abhinav Gaur

Thank you so much.

10 Oct 2011 saurabh korgaonkar

very very thank you for this function had been working ona program for almost full evening and finally was able to figure the decimal values were to blame :P

08 Jan 2012 Amarpal

I'm unable to get this function running on MATLAB 7.6.0 (R2008a). Any suggestions?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
rounding Glenn Gomes 22 Oct 2008 06:42:28
numbers Glenn Gomes 22 Oct 2008 06:42:28
decimal places Glenn Gomes 22 Oct 2008 06:42:28
mathematics Glenn Gomes 22 Oct 2008 06:42:28

Contact us at files@mathworks.com