How do i input this on MATLAB
조회 수: 11 (최근 30일)
이전 댓글 표시
How can i input x^3+px+q=0 on MATLAB and find x in terms of p & q?
댓글 수: 1
Image Analyst
2022년 7월 13일
Original question in case he edits this one away:
How can i input x^3+px+q=0 on MATLAB and find x in terms of p & q?
답변 (1개)
John D'Errico
2022년 7월 5일
Assuming that p and q are real numbers, do you understand there will ALWAYS be three solutions to the problem, and that for many values of p and q, exactly two of those solutions will be complex valued?
cubicroots = @(p,q) roots([1 0 p q]);
format long
cubicroots(2,3)
댓글 수: 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!