Write a matlab program that receives as input a number x

Assignment Help Basic Computer Science
Reference no: EM131263657

Write a MATLAB program that receives as input a number x and a parameter n and returns x rounded to n decimal digits. Write your program so that it can handle an array as input, returning an array of the same size in this case. Use your program to generate numbers for Example 2.2, demonstrating the phenomenon depicted there without use of single precision.

Example 2.2

We evaluate g(t) = e-t (sin(2πt)+2) at 501 equidistant points between 0 and 1, using the usual double precision as well as single precision and plotting the differences. This essentially gives the rounding error in the less accurate single precision evaluations. The following MATLAB instructions do the job:

2176_20cab1ae-9d39-4c64-90dd-cffbe4802705.png

Reference no: EM131263657

Questions Cloud

Firm produce at the equilibrium price : This firm operates in a perfectly competitive industry with market demand and supply curves given by Qd = 100 - 8P and QS = -20 + 2P, where Q is measured in millions of units. Based on the figure, how many units of output will the firm produce at ..
Develop your own project in order to test a hypothesis : In this assignment, you will develop your own project in order to test a hypothesis of your interest. Follow the following steps to do that: You will collect data on GPA for a particular department at the university
Travel time each way price of a skirt local department : Juanita is deciding whether to buy a skirt that she wants, as well as where to buy it. Three stores carry the same skirt, but it is more convenient for Juanita to get to some stores than others. For example, she can go to her local store, located ..
Compare and contrast holism versus reductionism : The paper will be five pages: (a) Describe Holism - 2 pages, (b) Describe Reductionism - 2 pages, (c) Compare and contrast Holism versus Reductionism - 1 page.
Write a matlab program that receives as input a number x : Write your program so that it can handle an array as input, returning an array of the same size in this case. Use your program to generate numbers for Example 2.2, demonstrating the phenomenon depicted there without use of single precision.
Determining the quantity of the product : Suppose that the long-run total cost curve for each firm is given by TC = 500Q - 20Q2 + Q3, where Q is the quantity of the product. Also suppose there is free entry and exit. To find the quantity where ATC is minimized, the firm would need to solv..
Normal and inferior goods : (a) Answer True or False to the following and provide a justification for your choice. (i) The price of a good X rises, causing the demand for good Y to fall. Thetwo goods are therefore substitutes.
Explain the storage scheme for single precision : The fraction in a single precision word has 23 bits (alas, less than half the length of the double precision word). Show that the corresponding rounding unit is approximately 6×10-8.
Income effect and substitution effect of the price change : a. What are the income effect and substitution effect of the price change? b. Are scallops a normal good or an inferior good? c. Is beef jerky a normal good or an inferior good?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Why is the second slightly more efficient

Why is the second slightly more efficient?

  What errors prevent the table displayed

What errors prevent the table displayed above from being first normal form compliant?Bring the table(s) into first normal form compliance without loss of any data. Identify primary and foreign keys (when present) for all tables.

  Assignment on polymorphism

Assignment on Polymorphism, How to design and define interface, How to implement methods declared in interface

  What is computer science

What is Computer Science. defining Computer Science and the kinds of jobs that computer scientists do.

  Explaining organization management responsibilities

Describe in scholarly detail common organization management responsibilities.

  Write an essay on turing machine explain with examples

Write an essay on turing machine explain with examples

  Draw erd with key attributes

The database should keep track of the date he/she started managing the school. Data stored on each school includes the school’s code, name, address (town, street and postcode) and phone. For the above scenario, you need to perform the following tasks..

  Evaluates the product by adding the multiplicand four times

Let the multiplicand be in register RR, the multiplier in register AR. and the product in register PR. An adder circuit adds the contents of BR to PR. A zero-detection circuit Z checks when AR becomes 0 after each time that it is decremented.

  Radius implementation

Suppose you are a Systems Administrator, and you have been tasked with implementing RADIUS to support authentication, authorization, and accounting in your organizations Windows network environment.

  Determine the length required for the heat exchanger

If the outlet temperature of the oil is 60°C, determine the total heat transfer and the outlet temperature of the water.

  Internet for meeting the educational

How can the same icts be used for multiple purposes? What steps are needed to use, say the internet for meeting the educational and health needs of poor female farmers in an isolated rural community?

  How is hardware different from software

what is a Web application? What are some features of a Web 2.0 site and how is hardware different from software?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd