Function to find roots in left half-plane and handle origin zero

2 replies · 2K views · last reply
noobienoob
Messages
3
Reaction score
0
i need to create a function that returns the pure zeros on the left semiplane and 0 if there is one and only one zero in the origin of the referential. the return has to be in a column vector like [root1;root2;...;rootn;0] or [root1;root2;...;rootn] if there is no root in the origin of the referential. i can get a column full of zeros or an empty vector. i can post the code of what i made if necessary.
 
Screenshot of the MATLAB editor showing a function named teste that takes polynomial coefficients p, computes roots, and filters roots in the left half-plane, above a Command Window showing the call teste with p = [1 8 17 10 0] and an answer of four zeros.
Screenshot of a MATLAB editor showing a function named teste that takes polynomial coefficients p, computes roots with roots(p), and loops over them, above a Command Window showing a call teste with p = [1 8 17 10 0] returning an empty ans.
 
that is what i got so far. but I'm stuck here...