I'm trying to write code in MATLAB that will round number to certain (as I ask) significant digits.
I'm not sure how to do it. Any suggestions?
I'm trying to write code in MATLAB that will round number to certain (as I ask) significant digits.
I'm not sure how to do it. Any suggestions?
To round to
d
significant digits:To round to
d
decimal digits:EDIT
Actually it's easier: the
round
function supports these options: