Finding approximate real solution to a equation
조회 수: 17 (최근 30일)
이전 댓글 표시
Can anyone please help me, how to find the approximate real solution to the following polynomial:
syms x
eqn=0.0941*x^3+0.1926*x-1500;
I used solve and simplify functions, but I don't get a real value.
댓글 수: 0
채택된 답변
Alan Stevens
2021년 9월 22일
You don't need syms here. Try the roots function.
help roots
댓글 수: 3
Alan Stevens
2021년 9월 22일
You could try something like
coeffs = [0.0941, 0, 0.1926, -1500];
r = roots(coeffs);
indicator = find(r==real(r));
disp(r(indicator))
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!