MATLAB: Positive roots only for cubic eqn

cubic equationhomeworkpositive roots

How I get positive roots x^3 − 5x^2 − 2x + 24 = 0 Using syms x eqn=x^3 − 5x^2 − 2x + 24 ==0

Best Answer

ROOTS = roots([1, -5, -2, 24]);
Wanted = ROOTS(ROOTS > 0)