Numerical LAB/ Third Class Procedure Write a MATLAB code to: 1-plot the graph of the function...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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', 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) 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', 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)
Expert Answer:
Answer rating: 100% (QA)
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 the full answer
Posted Date:
Students also viewed these computer engineering questions
-
In Problem, use the graph of the function f shown to estimate the indicated limits and function values. (A) (B) (C) (D) f(-2) (E) is it possible to redefine f(-2) so that Explain. Figure for 17-2...
-
In Problem, use the graph of the function f shown to estimate the indicated limits and function values. (A) (B) (C) (D) f(2) (E) is it possible to redefine f(2) so that Explain. Figure for 17-2 lim...
-
In problem, use the graph of the function f to solve the inequality. (a) f(x) > 0 (b) f(x) ¤ 0 y A 0 12
-
Khairul has been working with Tun Hamid Energy Bhd since 1 February 2009 as a Human Resource Executive. Beginning 1 January 2014, he was promoted as Human Resource Manager. Details of his...
-
Look up a leading institution in business responsibility in your region. (e.g., CSR Europe or China CSR), and analyze how it interprets responsible business by applying the considerations discussed...
-
(Multiple-step and Extraordinary Items) The following balances were taken from the books of Maria Conchita Alonzo Corp. on December 31, 2004. Interest revenue $ 86,000 Accumulated depreciation...
-
Use the information for Austin Automotive in Exercise E9-16 and assume a tax rate for the company of 30 percent. a. If Austin Automotive wants to earn an after-tax profit of \(\$ 135,800\), how many...
-
Butte Components produces a variety of hardware products, primarily for the do-it-yourself (DIY) market. As part of your job interview as a summer intern at Butte, the cost accountant provides you...
-
ACC 2201 Quiz 5 5.On December 15, 2024, sold $1,040 of gift certificates to a local gaming club. On December 31, 2024, determined that $510 of these gift certificates had not yet been redeemed. (Use...
-
Vincent Cardoza is the owner and manager of a machine shop that does custom order work. This Wednesday afternoon, he has received calls from two customers who would like to place rush orders. One is...
-
Use Black-Scholes Option (European) Pricing Model. Suppose a stock is trading today for $135.00. Stock annual volatility is 35.00%, and stock dividend yield is 2.50%. Suppose the annual risk-free...
-
Assume that in 2018, a copper penny struck at the Philadelphia mint in 1793 was sold for $270,000. What was the rate of return on this investment?
-
5. What is big O for below code: 2 points for(int i=0; i
-
Velocity of Fraud Schemes What I learned why it matters what good can it do for people Any other meaningful results. Explain these points briefly.
-
Dr. Frankenstein is a spinal surgeon. While performing surgery on Penelope Darling, he accidentally nicks Penelope's spinal cord. As a result, Penelope suffers a loss of mobility in her left leg....
-
Holland is now representing a new client, Roger. Holland asks you to assist with the initial assessment of Roger's case by interviewing Roger, analyzing the case and writing a summary report. The...
-
The "error bars" in bar graphs reflect the value of standard errors. They show the amount of variation in the samples. In the graph below, can you infer about the amount of variation in the data for...
-
Evaluate the line integral, where C is the given curve. C x 2 dx + y 2 dy, C consists of the arc of the circle x 2 + y 2 = 4 from (2, 0) to (0, 2) followed by the line segment from (0, 2) to (4, 3)
-
A decrease in supply results in a(n) _________ equilibrium price and a(n) _________ equilibrium quantity.
-
If supply decreases and demand increases, the equilibrium price will _________ and the equilibrium quantity will be _________.
-
If demand decreases and supply increases, but the decrease in demand is greater than the increase in supply, the equilibrium quantity will _________.
Study smarter with the SolutionInn App