Question

2) [6 pts] Consider the polynomial y x3-8x2 + 19x - 12 a) Create an anonymous function for y and use that for parts (b)-(d) b) Plot the function over the range 0 s x s 5. Use fplot. c) Find all zeros of the function d) Find the minimum point Using MATLAB functions, write a program to answer the question
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

%part a

fun = @(x) x.^3 - 8.*x.^2 + 19.*x -12;

%part b

fplot(fun,[0 5],'r');

%part c

z1 = fzero(fun, 0); % from graph we can see than one root is nearby 0

disp(z1);

z2 = fzero(fun, 2.5); % from graph we can see than one root is nearby 2.5

disp(z2);

z3 = fzero(fun, 3.8); % from graph we can see than one root is nearby 3.8

disp(z3);

%part d

m = fminbnd(fun,0 ,5); % minimum of single variable function

disp(m);

Ouput:

8 4 2 -2 -4 -10 -12 2 3 4

Add a comment
Know the answer?
Add Answer to:
Using MATLAB functions, write a program to answer the question 2) [6 pts] Consider the polynomial...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • popcorn while using less paper to manufacture them. il l suript can help manufacturers of popcorn...

    popcorn while using less paper to manufacture them. il l suript can help manufacturers of popcorn tubs to optimize it to carry Q5. The polynomial y is defined as (20 points) y 2 x4-7 x3- 44 x92.5 x262.5 (a) In a script file, Initials_MT_Pb_05.m, define y using an anonymous function. (b) Use the anonymous function to evaluate y when x-3, x-0, x-3. (c) Use the anonymous function handle to plot y for-4sxS 5.5 Hint: Use fplot. (d) Use the plot...

  • IN MATLAB 6. Construct Anonymous Functions to compute the functions below. Use the AFs within a...

    IN MATLAB 6. Construct Anonymous Functions to compute the functions below. Use the AFs within a program to find Flx) in the range x (0:0.1.3]. Print the results as a table with columns x, and F(o) f(x)=x3-x-2 for 0 f(x) = x3 _ x _ 1 for 1 1 x 2 f(x) =x3 _ χ for 2.5 x < 3 Construct the anonymous function f(x,y) as shown for the mathematical function below. This function will be used in the future...

  • i need Matlab code asap Write a program that evaluates the function f(x) = tan’x +...

    i need Matlab code asap Write a program that evaluates the function f(x) = tan’x + x - 2 between -27 and 27 in steps of 1/10 and plots the results. Create a function handle for your function, and use function feval to evaluate your function at the specified points. 2. Write a program that locates the zeros of the function f(x) = cos éx -0.25 between 0 and 27. Use the function fzero to actually locate the zeros of...

  • MATLAB questions. Please answer everything and explain for question 2. Using the Following Functions G()1672) and...

    MATLAB questions. Please answer everything and explain for question 2. Using the Following Functions G()1672) and H() - 54 S+1 s(s+2) 1. Enter the G(s) and H(s) functions. (Take advantage of using either symbolic tool or entering vector format with Commands like tf to generate the transfer function.) Your goal is to find the following: a) X(s) G(s) H(s) Y(s) Cascade system b) X1(s) G(s) Y(s) Parallel System X2(s) H(s) c) Feedback System (Hint: Use commands like cascade(tf), parallel(tf) and...

  • How do your write this in Matlab. Create a program that takes as input: An integer...

    How do your write this in Matlab. Create a program that takes as input: An integer nFunction that is either 1 or 2 indicating which of the two functions below to nsc * An integer n in [1.oc) indicating how many data points (ro."). ·The left endpoint a of an overall interval. (n泓) tote. The right endpoint b of an overall interval Your program should find the interpolating polynomial of degree less than or equal to of the requested function...

  • PLEASE USE MATLAB. THANK YOU! Consider the following polynomial equation: ax3 bx2 cx d 0 Write a program that allows th...

    PLEASE USE MATLAB. THANK YOU! Consider the following polynomial equation: ax3 bx2 cx d 0 Write a program that allows the user to enter the coefficients a,b,c and d and the search range needed for the Bisection method. The program should stop when the maximum error is less than 0.01. The program should display the root and also have a condition to stop when no roots are found in the range. Consider the following polynomial equation: ax3 bx2 cx d...

  • 1a): Find the roots of the following polynomial equations using matlab: f(x) = x^5 − 9x^4...

    1a): Find the roots of the following polynomial equations using matlab: f(x) = x^5 − 9x^4 + 31x^3 − 51x^2 + 40x − 12 f(x) = x^5 − 11x^4 + 47x^3 − 97x^2 + 96x − 36 b): Find the coefficients of two polynomial equations in matlab given the following sets of roots: r1 = [ 100 25 50 5 10 ]    r2 = [ 11 22 33 0 55 ] c): Create a figure with four subplots, each showing...

  • MATLAB PROGRAM FOR THE FOLLOWING PROBLEM Using Matlab write a program that will plot the pressure...

    MATLAB PROGRAM FOR THE FOLLOWING PROBLEM Using Matlab write a program that will plot the pressure signal, the perceived pressure signal, the resistance and the output voltage as functions of time, for Problem 1.30 in the textbook. (B) Using Matlab show a plot with the output voltage range if we happen to know that the transfer function (gain) has an uncertainty of 15% and the time constant has an uncertainty of 10%. (Note: the solution of the problem is provided...

  • please do this problem in matlab and show me the code. Thanks. please do this problem...

    please do this problem in matlab and show me the code. Thanks. please do this problem in matlab and show me the code. Thanks. please do this problem in matlab and show me the code. Thanks. please do this problem in matlab and show me the code. Thanks. please do this problem in matlab and show me the code. Thanks.please do this problem in matlab and show me the code. Thanks. please do this problem in matlab and show me...

  • please do this problem in matlab and show me the code. Thanks. please do this problem...

    please do this problem in matlab and show me the code. Thanks. please do this problem in Matlab and show me the code. Thanks. Problem #1: Circuits and linear-systems In the last HW you developed the governing equations for the “Wheatstone”-bridge circuit used extensively in engineering applications (shown below). B R R2 A D G m RA с E The resulting equations were solved for the output voltage and currents using the function: function [V_out, I_vector] =Wheatstone_bridge (v_in, R_vector) In...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT