View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Round Toward Vector of Values

5.0 | 2 ratings Rate this file 14 Downloads (last 30 days) File Size: 2.16 KB File ID: #37674 Version: 1.8

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 (2)
13 Dec 2016 Josh

Josh (view profile)

14 Jan 2013 Joey

Joey (view profile)

This is excellent

02 Aug 2012 1.2

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

03 Aug 2012 1.5

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

09 Aug 2012 1.8

Little tweaks for speed

Contact us