Question: Task 2: Find an estimate for a root by False Position Method (10 pts) Create and test a MatLab function called a3root_falseposition.m that implements the
Task 2: Find an estimate for a root by False Position Method (10 pts) Create and test a MatLab function called a3root_falseposition.m that implements the false position root finding method. Detailed Specifications for Task 2 Function Namea3root fal Functionalit Input Arguments (in this order) sition Implements false position root-finding method 1. Handle to function to be searched 2. Initial bracket lower bound Initial bracket upper bound 4. Maximum acceptable relative approximation error 5. Maximum table number of iterations Output Arguments (in this order)Number of iterations taken Approximation of root location Relative approximation error of solution Exit flag indicating termination status Valid Calling Syntax | root = a3rootfalseposition(fun, lb, ub, err-max, iter-max) [root, err] = a3root_falseposition(. . .) [root, err, numlter]- a3root falseposition(..) root, err, numlter, exitFlag]-a3root fal 1: algorithm terminated normally (due to errr being sufficiently small) 0: algorithm terminated due to max iterations being reached 1 : algorithm terminated due to invalid bracket specification (no root in tion Exit Flag Encoding bracket) 2: algorithm terminated due to invalid return value from function fun (e.g., NaN, Inf, empty bracket Notes The function should validate the input arguments to ensure they are of sufficient number, that they are of the right types, and that they are valid (iteration max should be positive, etc.). If validation fails, use the error function to terminate execution. Assume the function being passed via the function handle takes a scalar input argument and returns a scalar output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
