matlabmathsolverpolynomial-mathpolynomial-approximations

How to use fzero() to solve polynomial equation in MATLAB?


I would like to solve the following polynomial numerically for r:

I am trying to use fzero() as follows:

r = (5/(r^2*9))- ((2)/(9*(6-r)^2))
x0 = 10; % some initial point
x = fzero(r,x0)

How can this be done with fzero()?


Solution

  • pol =@(r) (5/(r^2*9))- ((2)/(9*(6-r)^2))
    x0 = 10; % some initial point
    x = fzero(pol,x0)
    

    solution

    x =  3.6754