New Word 2007 Document (20)

New Word 2007 Document (20) - help bisect_cosmx at the...

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

View Full Document Right Arrow Icon
1. Why is the name EPSILON all capitalized? 2. What does the sign(x) function do? What if x is 0? 3. What does the expression sign(fb) * sign(fc) <= 0 say about fb and fc ? 4. What is the purpose of the statement approxRoot = (xb+xa)/2; preceeding the while statement? 5. The disp command is used only to monitor progress. Note the use of ... as the continuation character. 6. Try the command: 7. x = bisect_cosmx ( 0, 3 ) Is the value x close to a root of the equation cos(x)=x ? 8. Type the command
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: help bisect_cosmx at the Matlab command line. You should see your comments reproduced as a help message. This is one reason for putting comments at the top. 9. For what input numbers will this program produce an incorrect answer ( i.e. , return a value that is not close to a root)? Add a check before the loop so that the function will call the Matlab error function (use the help facility for details on using error ) instead of returning an incorrect answer....
View Full Document

Ask a homework question - tutors are online