Question: Develop an M-file function called rounder to round a number x to a specified number of decimal digits, n. The first line of the function

Develop an M-file function called rounder to round a number x to a specified number of decimal digits, n. The first line of the function should be set up as

function xr = rounder(x, n)

Test the program by rounding each of the following to 2 decimal digits: x = 477.9587, − 477.9587, 0.125, 0.135, − 0.125, and − 0.135.

Step by Step Solution

3.38 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the Mfile function called rounder that rounds a number x to a specified num... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Applied Numerical Methods Questions!