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

조회 수: 8 (최근 30일)
Karl
Karl 2022년 9월 11일
답변: Walter Roberson 2022년 9월 11일
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.

채택된 답변

Walter Roberson
Walter Roberson 2022년 9월 11일
round(YourMatrix + 0.001, 2)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by