Note Well: The purpose of lab exercises is for you to learn how to solve problems using these tools. It is not for you to type something into MATLAB. As you go through the steps of each exercise, think about what you are doing and what the program is doing, and try to predict what you will see. If you don't understand something, ask your instructor -- that's what he's there for.
Your cousin Ella's 8th grade algebra class played a Halloween trick on Ms. Grundy. Ms. Grundy struck back with a trick of her own. For homework, along with equations like "x2 + 2 = 3x", she gave them this one:
Find all values of x for which 2x > x8. Also, graph the resulting inequality, 2x - x8 > 0.
Ella is fearful that this will ruin her life by destroying her perfect middle school grade point average. She is hoping that, as a bright engineering major at UK, you can help her. Don't let Ella down. Use MATLAB and/or Excel to help Ella solve this problem and convince Ms. Grundy that her solution is correct.(Do this by solving the problem yourself and convincing your TA by showing him your files and graph and explaining the approach you took and why it gives a correct result. Make sure you fully explore the inequality to make sure you have found all the values of x that satisfy it. When your TA is convinced, zip your files together and upload them to CS Portal.)
Write a function named bisection() that takes four arguments:
Note the following:
Iteration: 1 Lower: 0.500000 Upper: 1.000000 Estimated Root: 0.750000
function f = equation(x) f = 7*x-6; endCall your bisection function as follows: bisection(@equation, 0, 1, 0.0001).
(You should also test it with other functions, of course.)
Upload your function bisection.m to the submission portal as "Lab Ex 9, Part 2".