To convert the roots obtained from symbolic constants to double, you can use the double
function in MATLAB. First, use the roots()
function to obtain the roots in symbolic constants. Then, convert them to double using the double()
function. Here's an example:
main.m186 chars12 lines
In this example, p
is a vector representing a polynomial equation. The roots()
function is used to obtain the roots of this equation in symbolic constants, which are stored in variable r
. The double()
function is used to convert r
to double, and the resulting roots are stored in variable r_double
. Finally, the roots in double precision are displayed using disp()
.
gistlibby LogSnag