Question: Numerical LAB/ Third Class Procedure Write a MATLAB code to: 1-plot the graph of the function f(x)=f(x) = x + 4x - 10 =

Numerical LAB/ Third Class Procedure Write a MATLAB code to: 1-plot the graph of the function f(x)=f(x) = x + 4x - 10 = 0. Plot the function in the interval [0, 3]. 2.Find a root of the function using the initial interval [1, 2]. Perform the iterations of the Bisection method. Solution: 2 3 4 5- 7 65 Editor - Untitled2.m Untitled2.m x Untitled.m X + ROOT FINDING USING BISECTION METHOD 8 9 10- 11 - 12- 13- 14- 15- 16- 17- 18 19 - 20 21- 22- 23 24- 25 clear all clc % first plot the function x=0:0.1:3; f=@ (x) (x.^3) + (4* (x.^2))-10; plot (x, f(x)) grid C: Users Predator Documents MATLAB * Second Compute the roots of equation a=1; b=2; tol=0.00001; fa=f(a); fb=f(b); n=0; Ewhile (abs (a-b) > tol) T xmid=(a+b)/2; fxmid=f(xmid); fprintf('%13.4f %13.4f %13.4f %13.4f $13.4f %13.4f $13.4f ', n, a, b, xmid, fa, fb, fxmid) if (fa *fxmid > 0) a=xmid; else b=xmid; end n=n+1; end Exp.1 3- Repeat steps 1 and 2 for f(x) = x-cos(x) =0 with x=0.5 and 1. 4-Attach your MATLAB code and screen shot for results (graph and table)
Step by Step Solution
3.46 Rating (153 Votes )
There are 3 Steps involved in it
1 2 Matlab script to plot the graph of the function fx x3 4x2 10 in the interval 0 3 and then find the root of the function in the interval 1 2 using ... View full answer
Get step-by-step solutions from verified subject matter experts
