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

  Questions on ferris wheel

Prepare a Flexible Budget Gator Divers is a company that provides diving services such as underwater ship repairs to clients in the Tampa Bay area.

  Logistic map

This assignment has two question related to maths. Questions are related to bifurcation cascade and logistic map.

  Finding the probability of cards

This assignment has questions related to probabiltiy.

  Systems of ode

Find all the xed points, and study their stability and Draw the phase portrait of the system, as well as the graphs of the solutions in all relevant cases.

  Derive the boolean expression

Derive the Boolean Expression and construct the switching circuit for the truth table stated

  System of equations

Evaluate which equations are under-identified, just-identified, and over-identified.

  Linear programming problem

Linear programming problem consisting of only two constraints with one objective function.

  Find the natural domain

Find the natural domain of the given functions.

  Introduction to numerical methods

Compute the coecients of the polynomials using the term recurrence relation.

  Chart of the topological manifold

De?nition of smoothness of functions on a smooth manifold is chart independent and hence geometric.

  Mathematics in computing

Questions related on mathematics in computing.

  Complex problems

Complex problems

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