Learn R Programming

matlab2r (version 1.5.0)

fix: Round toward zero

Description

Rounds each element of input to the nearest integer towards zero. Basically the same as trunc()

Usage

fix(X)

Value

The values of trunc(X).

Arguments

X

input element

Author

Waldir Leoncio

Examples

Run this code
X <- matrix(c(-1.9, -3.4, 1.6, 2.5, -4.5, 4.5), 3, byrow = TRUE)
Y <- matrix(c(-1, -3, 1, 2, -4, 4), 3, byrow = TRUE)
fix(X)
fix(Y)

Run the code above in your browser using DataLab