Develop an M-file function called rounder to round a number x to a specified number of decimal
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 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.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 66% (3 reviews)
Heres the Mfile function called rounder that rounds a number x to a specified num...View the full answer
Answered By
Aricayos Apple
I'm a highly professional tutor and academic freelancer , with over 5 years of experience. I became one of best tutors in Chegg tutoring community and Course Hero having high helpful rate. I love helping students understand Business courses related, as it is my passion to tutor and and help students understand these amazing subjects as attached in my skills. I am also an expert on the subject of history related subjects since at one point had handled these subjects. I also have a bachelor's degree in bachelors of science in Business Administration from City of Malabon University in Philippines. I am currently working on getting a master's degree in the field Business Administration from City of Malabon University. Meanwhile, you can learn how to solve complex problems consistently with me.
0.00
0 Reviews
10+ Question Solved
Related Book For
Applied Numerical Methods With MATLAB For Engineers And Scientists
ISBN: 9781259027437
3rd Edition
Authors: Steven C. Chapra
Question Posted:
Students also viewed these Mathematics questions
-
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 nd = days(mo, da, leap) where mo...
-
Develop a well-structured function to determine the elapsed days in a year. The first line of the function should be set up as function nd = days(mo, da, year) where mo = the month (1-12), da = the...
-
The following text talks about how the Expenditure cycle works in an organization The expenditure cycle is a recurring set of business activities and related information processing operations...
-
Let B > 0. Show that the maximum of (x 1 , . . . , x n ) = x 1 + + x n subject to x 2 1 + + x 2 n = B 2 is nB. Conclude that for all numbers a,..., an lal++lanl n(a + + a) / 1/2
-
In Problem 13.6 on page 470, you used the total worldwide revenue ($ millions) and full time voluntary turnover (%) stored in BestCompanies to predict the number of full time jobs added. a. Perform a...
-
A truncated solid cone is of circular cross section, and its diameter is related to the axial coordinate by an expression of the form D = ax 3/2 , where a = 1.0 m- 1/2 . The sides are well insulated,...
-
For each of the following situations, calculate the degrees of freedom \((d f)\), identify the critical values (assume \(\mathrm{a}=.05\) [two-tailed]), calculate the standard error of the mean \(s\)...
-
An investor sells a stock short for $36 a share. A year later, the investor covers the position at $30 a share. If the margin requirement is 60 percent, what is the percentage return earned on the...
-
Suppose that the figure below shows the short-run marginal cost (MC) and average cost (AC) curves for Tesla - the largest manufacturer of electric vehicles, with costs on the vertical axis and the...
-
Develop an M-file function to determine the elapsed days in a year. The first line of the function should be set up as function nd = days(mo, da, year) where mo = the month (112), da = the day (131),...
-
The derivative of f (x) = 1/(1 3x 2 ) is given by Do you expect to have difficulties evaluating this function at x = 0.577? Try it using 3- and 4-digit arithmetic with chopping. 6 (1 - 3x)
-
A satellite in orbit is not truly traveling through a vacuum. It is moving through very, very thin air. Does the resulting air friction cause the satellite to slow down?
-
Consider the following two bonds with the same yield-to-maturity (YTM) of 6%: Bond A is a 15-year, 25% coupon bond, and bond B is a 5-year, 5% coupon bond. 1. Calculate the prices for both bonds. 2....
-
In December 2015, the FBI attained the iPhone of one of the shooters in an ISIS-inspired terrorist attack that killed 14 people in San Bernardino, California. As part of the investigation, the FBI...
-
(NPV) A company has the choice between two different types of machines. Machine A costs less, but it also has a shorter life expectancy of two years. B costs more but lasts longer for four years. The...
-
For the following graph, Show all the steps of the Depth First Search traversal starting with vertex 1. 4 5 7 3 6 2 1
-
The QA team lets the development team know that there are serious concerns with code quality as only 10% of the program submitted has been able to pass foundational QA checks. As the project manager,...
-
Calculate the impulse-response functions. Explain the four functions and discuss your findings. Comment on whether the ordering of the series matters for your results.
-
Find the numerical value of each expression. (a) sech 0 (b) cosh -1 1
-
A total charge Q is uniformly distributed around a ring-shaped conductor with radius ?. A charge q is located at a distance x from the center of the ring (Figure). The force exerted on the charge by...
-
Figure shows a circuit with a resistor, an inductor, and a capacitor in parallel. Kirchhoff?s rules can be used to express the impedance of the system as Where Z = impedance (?) and ? = the angular...
-
For fluid flow in pipes, friction is described by a dimensionless number, the Fanning friction factor . The Fanning friction factor is dependent on a number of parameter related to the size of the...
-
b) Find the minimum spanning tree for the following graph using Kruskal's algorithm. 3 5 7 5 7 3 Does this graph have a unique minimal spanning tree? Justify your answer.
-
Suppose a two-dimensional even parity scheme is used for single-bit error detection and cor- rection, whereby datawords of 36 bits are broken into 6 words having six bits each, two form a 6x6 matrix,...
-
Javier has sold short 2,400 shares of Omega Inc. at $42 per share. The initial margin requirement was 50% on the short sale. His broker requires a 35% maintenance margin. Omega pays no dividends....
Study smarter with the SolutionInn App