Code covered by the BSD License  

Highlights from
Round Toward Vector of Values

5.0 | 1 rating Rate this file 14 Downloads (last 30 days) File Size: 2.16 KB File ID: #37674

Round Toward Vector of Values


Tom R (view profile)


31 Jul 2012 (Updated )

Round values towards a given vector of choices.

| Watch this File

File Information

This function will round an inputed matrix, of any size, and round each value towards the vector of choices given. It can also be given a type of round ('floor','fix','ceil','round','away'), and will round toward -inf,0,inf,closes value respectively, or away from 0 respectively.


This file inspired Round To X.

MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
14 Jan 2013 Joey

Joey (view profile)

This is excellent

02 Aug 2012

Fixed problem with round when the number is in between two integers.

03 Aug 2012

The function can now round away from 0 (the opposite of floor).

09 Aug 2012

Little tweaks for speed

Contact us