5.0

5.0 | 1 rating Rate this file 25 downloads (last 30 days) File Size: 1.14 KB File ID: #24213

ROUND2DP

by Andrew

 

20 May 2009

Code covered by the BSD License  

Round a number to a given number of decimal places

Download Now | Watch this File

File Information
Description

This expands on the operation of the built-in ROUND function to provide functionality to round to a given number of decimal places. For example,

>> round(pi)
ans =
   3

>> round2dp(pi,3)
ans =
    3.142

MATLAB release MATLAB 7.6 (R2008a)
Zip File Content  
Other Files license.txt,
round2dp.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
25 Aug 2009 Derek Fryar  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
round Andrew 20 May 2009 09:21:53
decimal Andrew 20 May 2009 09:21:53
precision Andrew 20 May 2009 09:21:53
decimal places Andrew 20 May 2009 09:21:53
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com