

My answer to this question provides other way that various MuPAD solvers can be used, particularly if you can isolate and bracket your roots. S = feval(symengine,'numeric::solve',fpp(x)=0,x,'AllRealRoots') In particular is the 'AllRealRoots' option. MuPAD's numeric::solve function has several additional capabilities. However, one can access the features of MuPAD from within Matlab.

Instead, it returns only the first solution that it finds." Some equations can have an infinite number of numeric solutions (e.g., periodic equations), and thus, as per the documentation: "The numeric solver does not try to find all numeric solutions for equation. When this fails, it tries to find a numeric solution.


Other solutions or suggestions for solving these problems are welcomed.Īs I indicated in my comment above, sym/solve is primarily meant to solve for analytic solutions of equations. But, I have no idea how I can generally find initial guessed values to obtain all solutions, which is my second question. I know that vpasolve with some initial guess can handle this. I am not satisfied since all solutions are not returned (they are approximately -1.5056, 1.5056, -0.5663 and 0.5663 obtained from WolframAlpha). (This is related to this question.) Moreover, when I try to solve the equation solve(fpp(x)=0,x,'Real',true) The first question: Is it possible to force Matlab's solve to return the set of all solutions? Remember the order which with you enter coefficients in the code affect the result, and always remember to put 0 to indicate where the coefficient is not existent for lower exponents of the equation.Solve([0.0 < (8.0*exp(-1.0/x^2))/x^4 - (2.0*exp(-1.0/x^2))/x^2. The higher-order the higher number of coefficients. The only difference here is that we have non-zero third-order coefficient to add to it roots()ĭo not forget to add 0 between 6 and -20 since the first-order coefficient is zero The line of code to solve it won’t be that different compared to the previous one. To solve this equation with Matlab you will enter the following code roots()Īnd Matlab will give you the roots of the polynomial equation Let’s go ahead and solve the following equation with Matlab So you will also find quadratic equations in the form
