MATLAB GURU FETEX 2014 (Q.3 with Solution Codes)

Posted on at


Q3. Descartes' Rule of Signs

a) The number of positive real zeros of a polynomial P(x) either is equal to the number of variations in the sign between terms of P(x)  or is less than that integer by an even integer number.

b) The number of negative real zeros of a polynomial P(x) either is equal to the number of variations in the sign between the terms of P(-x) or is less than that integer by an even integer number.

 

 

 

 

 

 

 

 

Write a MATLAB program that takes the coefficients of a polynomial in the form of a vector as input from the user and returns possible number of positive and negative real zeros.
(Hint:
You are required to calculate sign changes between terms of P(x) and P(-x) without using roots( ) function of MATLAB )

Example for Testing You code:

Input and output should look like this. 

Solution :

 

Authored by : Shahid Ali Murtza



About the author

160