Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Math 9 Summer Session I 2024 MATLAB Homework #3 Corresponding Outcomes: EO3, EO5, GOMa1l, GOMA2, GOMa3, GOMa4 Instructions Part A: MATLAB matching game! You will
Math 9 Summer Session I 2024 MATLAB Homework #3 Corresponding Outcomes: EO3, EO5, GOMa1l, GOMA2, GOMa3, GOMa4 Instructions Part A: MATLAB matching game! You will be given 20 total cards. Each of the 20 cards assigns a value to a variable. Ten of the cards assign a value to d, and ten of them assign a value to z. Each d variable has the same value as exactly one of the z variables. Your job is to match the cards. For example, if card 1 defines d = [1, 2, 3, 4] and card E defines z = [1, 2, 3, 4], then card 1 matches card E. In a group of 1-3 students, match up the cards. This is good practice for our Outcome Quizzes, so try to use the computers as little as possible. To submit this part of the assignment, put the names of your group members at the top of a sheet of paper, and list how the cards match. For example, your answer might look like: card 1 = card E card 2 = card A and so on. No additional justification is necessary. Advice: The randi() function shows up on this homework, even though we have not quite seen it in our lectures yet. You will need to read the documentation for it to understand what it does! Don't forget about the help command. Part B: Practice with Bisect Method The goal of this portion of the homework is to write a function bisectnew(f,x1,x2) that works the same as the bisect method function from our video lectures, but with the following differences. (Hint: If the original code for the bisect method doesn't make sense, definitely try to understand that first!) For this portion of the homework, you will be uploading the m file you wrote. 1. The function bisectnew should work as long as f(z1) and f(z2) have different signs. (In other words, if f(x1) is positive and f(z2) is negative, the function should work, and if f(z1) is negative and f(z2) is positive, the function should also work.) If you find yourself copying and pasting a block of code, that is not a reasonable approach (because then, if you change the code in one section, you also have to remember to change it in the other section). 2. Use the 'error' command in Matlab to display an error if f(z1) and f(z2) have the same sign. The syntax to use is error(msg), where msg is a string with the error message you want to display. 3. Instead of having an error threshold as input to bisectnew, use 1000-max (eps(x1),eps(x2)) as the error threshold. 4. Write your answers to the following questions as comments at the end of the bisectnew function. (a) Setting the error threshold to bemin(eps(x1), eps(x2)) would not make sense; explain. (This is a good point to understand, but it also probably the least important question on this homework.) (b) Describe why the bisect method does not work if you apply it to the function tan(z) with the inputs z = 1 and z = 2. (c) If we apply the bisect method to the function y = f(z) graphed below for the inputs x = 5 and x = 5, what zero is approximated? (The three zeros are approximately z = 1.9,.3,1.5.) (d) If we apply the bisect method to the function y = f(z) graphed below for the inputs z = 11 and z = 5, what zero is approximated? (The three zeros are approximately z = 1.9, .3, 1.5.) (e) If we apply the bisect method to the function y = f(z) graphed below for the inputs = 1 and z = 5, what zero is approximated? (Trick question.) Part C: Pick any question or concept you've seen in Math 9 so far and imagine you are explaining to a friend who has never coded before how you were able to solve the problem or understand the concept. Write this explanation on the Ed Discussion thread for this homework. Alternatively, if one of your classmates writes an explanation that really clarifies things for you, write a comment letting letting them know what in their explanation made it click for you. (Only one post per group needs to be made, but all group members are welcome to make their own posts and comment.) Card 1 Card 2 d = [1]; while d(end)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started