Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

round (MathScript RT Module Function)

LabVIEW 2011 MathScript RT Module Help

Edition Date: June 2011

Part Number: 373123B-01

»View Product Info

Owning Class: basic

Requires: MathScript RT Module

Syntax

c = round(a)

Description

Rounds input elements to the nearest integer value.

Examples

Inputs

Name Description
a Specifies a real or complex scalar, vector, or matrix.

Outputs

Name Description
c Returns the elements of a rounded to the nearest integer value. If the fractional component of an element in a is 0.5, LabVIEW rounds away from zero. If a is complex, LabVIEW computes the nearest integer values using the following equation: c = round(real(a))+round(imag(a))*i. c is a scalar, vector, or matrix of the same size as a.

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Yes

Examples

% The expected result is:
% [-4, -3, -2, -1, 1, 3, 4]
A = [-3.7, -2.5, -1.5, -1.2, 1.3, 2.5, 3.7]
C = round(A)

Related Topics

ceil
fix
floor


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit