Matlab problems

Assignment Help Mathematics
Reference no: EM13840496

Matlab Problems

1. The function below is broken.

  • It does not always correctly report a zero at an endpoint of the supplied bracketing interval [a, b].
  • Something is wrong with the implementation of the Bisection Algorithm
  • It should return the midpoint of the last bracket after exiting the while loop.

Submit a printout of the corrected function.

Also use the diary command to capture the output of the following test code on the Matlab command

line and submit that as well.

----------------

>> f=inline('(x-1)*(x-2)')

>> BisectionMethod(f,3,3,0.01,10)

>> BisectionMethod(f,1.5,2,0.01,10)

>> BisectionMethod(f,1,3,0.01,10)

>> BisectionMethod(f,1.5,3,0.01,10)

>> BisectionMethod(f,1.5,3,0.001,10)

>> BisectionMethod(f,1.5,3,0.001,100)

2259_Matlab Function.jpg

2. Below is a function that implements Newton's Method. Modify it so it instead implements the secant method (without calling another function ). Don't forget to rename it and modify the comments below the function name. Submit your function typed. Recommendtesting it before submit it. However, output is not requested.

function x = NewtonsMethod(f,fp,x0,N)
%Required parameters: a function f, its derivative fp, a starting point
%and the number of iterations to perform.
xcurrent=x0;
for i=1:N
xnew=xcurrent-feval(f,xcurrent)/feval(fp,xcurrent);
xcurrent=xnew;
end
x=xcurrent;
end

Reference no: EM13840496

Questions Cloud

What are the potential security risks in implementation : What are the potential security risks in implementation of such a system? For the purpose of this assignment, you will make necessary assumptions, validate the same, and then provide a well-researched and informed report to the CEO.
How would you measure the different forms of debt? : How would you measure the different forms of debt?
What types of studies were involved in campbell-ewald : What types of studies were involved in Campbell-Ewald's respect initiative? What are the strengths and weaknesses of the various methodologies
Demonstrate a perspective on theory of organizational change : Demonstrate a perspective on the theory and practice of organizational change, through examination of relevant current research.
Matlab problems : The function below is broken.
Create a 3-d clustered column chart of the divisions : Create Line sparklines in column F in the Earnings sheet to show the trend by quarter for each division. Show the high point for each sparkline. Apply the Sparkline Style Colorful #5 style. Create a 3-D Clustered Column chart of the divisions and t..
Overcoming intercultural barriers : Overcoming Intercultural Barriers
What is the firms total assets turnover? : What is the firm's total assets turnover?
Product contamination is catastrophic event : Product contamination is a catastrophic event, both for the organization at fault and for the victims. Cases of product contamination frequently make the news. Find an example of product contamination that occurred and discuss the way in which the or..

Reviews

Write a Review

Mathematics Questions & Answers

  What is the optimal solution

assume that all doors produced can be sold for a profit of $500 and all windows can be sold for a profit of $400. Formulate an LP model for this problem. sketch the feasible region. what is the optimal solution?

  Examples of product rule of exponents

Examples of the product rule of exponents: Sometimes when students see the rule they want to write it as 4^2 + 4^3 = 4^5. Can you explain why this does not work?

  What dimensions will give him the maximum area in the garden

alan is building a garden shaped like a rectangle with a semicircle attached to one short side. if he has 60 feet of fencing to go around it, what dimensions will give him the maximum area in the garden?

  Fixed point iterations

The equation x - 3 ln x = 2 has exactly two solutions A and B, with 0

  Find the rate of change of the radius

Let A be the area of a circle with radius r that is increasing in size with respect to time. If the rate of change of the area is 12 cm/s, find the rate of change of the radius when the radius is 18cm.

  Probability that the friends order only cotton sweatshirts

Each of four friends orders a sweatshirt from a catalog. There are 15 colors of sweatshirts, 6 of which are all cotton and 9 of which are a blend. Each one orders a different color (no repeats) at random. What is the probability that the friends o..

  At what speed does chuck travel

Chuck travels 117 miles in the same time that dana travels 105 miles. If chuck rate of travel is 4mph more than dana's, and they travel the same length of time, at what speed does chuck travel?

  Find the amount of work to fill up the trough

First give the integrand expressed in terms of h, the terms of the height in feet from the bottom of the trough.

  A company that manufactures laser printers for computers

A company that manufactures laser printers for computers has monthly fixed costs of $177,000 and variable costs of $650 per unit produced. The company sells the printers for $1,250 per unit. How many printers must be sold each month for the compan..

  What is the speed on each part of the trip\

eist travels 34 miles at a certain speed. The conoeist travels 6 miles on the second part of the trip at a speed at 5 mph slower. The total time of the trip is 5 hours. What is the speed on each part of the trip.

  What was the cost of advertising and warehouse expense

a company has two major businesses that it operates. one business manufactures and sells unicycles for commercial use

  How much volume is added to a spherical balloon

To the nearest tenth of a cubic inch, how much volume is added to a spherical balloon whose radius grows from 10 to 20 inches long?

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