matlab round()
时间: 2023-11-02 10:25:30 浏览: 137
MATLAB画圆
The round() function in MATLAB is used to round the values of an input array to the nearest integer. It takes a single input array as an argument and returns an array of the same size as the input array with each element rounded to the nearest integer.
Syntax:
y = round(x)
where x is the input array and y is the output array with rounded values.
Example:
x = [2.3 4.7 3.2 5.9 1.1]
y = round(x)
The output would be:
y = [2 5 3 6 1]
Here, the values in array x are rounded to the nearest integer and stored in array y.
阅读全文