How do I round a number with a specific tolerance in MATLAB?

8 visualizzazioni (ultimi 30 giorni)
Hi all, I am simply trying to set .004 as the tolerance when a number will round up for a variable. So if my variable calculates something like 2.334 or higher .001-.005, it will round to 2.34... if it calculates to 2.333 or lower .001-.002, it will round to 2.33.

Risposta accettata

Walter Roberson
Walter Roberson il 11 Set 2022
round(YourMatrix + 0.001, 2)

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by