New Word 2007 Document (16)

New Word 2007 Document (16) - root which I will call...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
The language of this description is based on a computer language called Algol that is now mainly used in papers in order to specify algorithms. One objective of this lab is to show how to rewrite it in the Matlab language. As a starting point, let's fix cosmx as the function and leave it out of the calling sequence. Let's also fix epsilon=1.0e-6 . Note also that, in Matlab, returned values are separated from arguments, so the variable
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: root , which I will call approxRoot to make a point, is written on the left of an equal sign. The first few lines of the file bisect_cosmx.m should be: function approxRoot = bisect_cosmx( xa, xb) % approxRoot = bisect( xa, xb) uses bisection to find a % root of cosmx between a and b to tolerance 0.000001 % xa=left end point of interval % xb=right end point of interval % cosmx(xa) and cosmx(xb) should be of opposite signs...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online