Using root function to complete the turning point function that solves the derivates of a polynomial
Ältere Kommentare anzeigen

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 Kommentar
Torsten
am 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]
represents
p(x) = 2*x^2 + x + 0.5
and
a = [10 -9 3 1]
represents
p(x) = 10*x^3 - 9*x^2 + 3*x + 1
Antworten (1)
Paul
am 27 Aug. 2022
0 Stimmen
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.
Kategorien
Mehr zu Polynomials finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!