Using root function to complete the turning point function that solves the derivates of a polynomial

5 views (last 30 days)
I was asked to complete the following turning point function using root function to solve the derivates of the polynomial up to x^n. I am really struggling with this one. Any help would be appreciated.
function x = turning_points(a)
% x = turning_points(a) returns the values of x such that p'(x) = 0, where
% p(x) = a(1) + a(2)x + a(3)x^2 + ... + a(n+1)x^n.
  1 Comment
Torsten on 27 Aug 2022
The examples given are wrong.
The polynomial representation in MATLAB is in descending powers of x, thus
a = [2 1 0.5]
p(x) = 2*x^2 + x + 0.5
a = [10 -9 3 1]
p(x) = 10*x^3 - 9*x^2 + 3*x + 1

Sign in to comment.

Answers (1)

Paul on 27 Aug 2022
Hi Laidog,
I suggest starting with this doc page. It will show how to reperesent and analyze polynomials in Matlab and contains links to the functions needed to solve this problem.


Find more on Polynomials in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!