How to round numbers in the matrix

16 次查看(过去 30 天)
There is a matrix 3×3 containing numbers from 0 to 1, but each number contains many decimals such as 0.120886554436, 0.0925684799, and so on... How can I round each number in the matrix to three decimals, for example, to make the number as the following 0.121, 0.092,....?

采纳的回答

Ghazwan
Ghazwan 2022-10-10
Y = round(X,N)
% For more info: https://www.mathworks.com/help/matlab/ref/round.html

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by