Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Procedure As usual, create a script, include a comment at the top explaining the purpose of the script, your name, and the date it was created

Procedure As usual, create a script, include a comment at the top explaining the purpose of the script, your name, and the date it was created

Sociology

Procedure As usual, create a script, include a comment at the top explaining the purpose of the script, your name, and the date it was created. 1. Use the menu function to ask the user if they would like to estimate e or phi. Use the input function to prompt the user to select a desired accuracy (tolerance) between .1 to .01. Include error checking to ensure the user input corresponds to your desired format. See the page on Input Error Checking for an example of how to do this. Use a conditional or switch statement to select between the two estimation functions that you will write (see below). 2. To write your function to estimate e, create a function that accepts as input the user's desired tolerance and outputs the estimate of e and the number of iterations required to meet the desired accuracy. Your function header will look like: function (myE, numlters] = estE?tol). Use the limit equation above for large n and compare the result to MATLAB's built-in value for e. While the absolute value of the difference between e and your estimated e is greater than the tolerance, continue looping and increasing n. 3. Use a similar method to estimate phi. Since MATLAB has no built-in constant for phi, create your own true phi using Equation 1 above. 4. Create a text file to keep track of your progress at each iteration with the fprintf command (you may have to print every 100 iterations or even 1000 iterations if it takes a long time to reach the desired accuracy). Report the iteration, the estimated value and the absolute value of the difference between the estimated and true values at each step. Here's a sample output: After 133 iterations, estimated e is 2.708133 and error is 0.010149. After 134 iterations, estimated e is 2.708208 and error is 0.010074. After 135 iterations, estimated e is 2.708282 and error is 0.010000. Turn-in Instructions You will need to submit .m files for each function you define, main.m, estE.m and estPhi.m as well as your text log file. Each .m file should include your name and function description in comments. Upload your files via Canvas. Let me know if you have any questions! Figure 1. The Golden Ratio in Engineering Design Introduction Function and aesthetics are often governed by mathematics. Beautiful examples of this can be found in nature, from the growth pattern of plants to the feature placement on the human face. Read a low-tech blog post e about how Aston Martin uses the golden ratio in car design. The Golden Ratio, phi, is defined by: 1+V5 4 2 Equation 1. Exact Phi One way that phi can be approximated is by taking the limit as n goes to infinity of a term in the Fibonacci sequence divided by it's proceeding term: 4 ? limnto fr fn-1 Equation 2. Estimated Phi Be sure to read the module page on Printing to Log Files because it contains code on how to compute terms of the Fibonacci sequence. Similarly, e can be approximated by: e = limn400 (1 + )" Equation 3. Estimated E We will use our new input and output tools to create an iterative estimation program for both e and phi and compare our estimates to the true values. function (admissionStatus] = computeAdmissionStatus (student) % This function uses the students GAP and SAT score to determine if a % student qualifies for an admission in their respective department. % INPUTS: student vector with department code, GPA and SAT scores % OUTPUT: Admission status (admitted, denied or pending) % AUTHOR: Hussein Aljebur dept = identifyMajor (student); % The average department GPA and SAT scores

Option 1

Low Cost Option
Download this past answer in few clicks

18.89 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE