Solving a cubic polynomial by using two loops

I want to solve a cubic equation of the form a*Z^3+b*Z^2+c*Z+d=0, where b=0.0:0.01:10 and c=0.0:0.1:10. I'm new to MATLAB, can anyone help me out?

댓글 수: 1

Sorry, but this makes no sense. You claim a polynomial with FOUR coefficients, but you want to specify only two of them. So the result will still be a nasty complex mess. And that means your question is still mathematically under-posed.
Anyway, make an effort! Start by writing a pair of nested loops. This is still effectively homework. If we do your thinking for you, then you will learn nothing, except that you can get some fool to do your work for you. Think about what result you will expect. After all, this is a CUBIC polynomial. How many roots are there? Once you define all four coefficients, how many roots does a cubic have? May some of them be complex?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

2021년 2월 17일

댓글:

2021년 2월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by