How to round numbers in the matrix

14 vues (au cours des 30 derniers jours)
M
M le 10 Oct 2022
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,....?

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by