Write a user-defined MATLAB function that uses bisection method to determine the
ID: 3847028 • Letter: W
Question
Write a user-defined MATLAB function that uses bisection method to determine the solution of f(x) in a given interval a lessthanorequalto x lessthanorequalto b For function name and arguments, use x = Bisection(f, a, b) The function should first check if a solution exists in the given interval. The function should stop and return the answer when any the of following criteria is met: estimated relative error becomes less than 0.001 tolerance in f(x) becomes less than 0.01 number of iterations reaches 1000Explanation / Answer
disp('This program convert Celsius to Fahrenheit'); val = input('Type 1 for Celcius to Farenheit and Type 2 for vice versa: '); switch val case 1 Celsius=input('Write a temperature in Celsius and you''ll have the result in Fahrenheit: '); disp([ 'x = ' num2str(Celsius) ' Celcius and y = ' num2str(Celsius*1.8+32) ' Fahrenheit']); case 2 Faren=input('Write a temperature in Farenheit and you''ll have the result in Celcius: '); disp([ 'x = ' num2str(Faren) ' Fahrenheit and y = ' num2str((Faren-32)/1.8) ' Celcius ' ]); end
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.