ceil#

Purpose#

Round up toward \(+∞\).

Format#

y = ceil(x)#
Parameters:

x (NxK matrix) – Values to be rounded.

Returns:

y (NxK matrix) – Rounded values.

Examples#

// Values to be rounded
x = 10*rndn(2, 2);
y = ceil(x);

After the code above, the matrices x and y should hold values similar to below. Answers will vary due to the use of random numbers as the input to the ceil function.

x = 8.73383  -0.783488  y = 9.0000000  0.0000000
    13.1106   7.155113      14.000000  8.0000000

Remarks#

This rounds every element in the matrix x to an integer. The elements are rounded up toward \(+∞\).

See also

Functions floor(), trunc()