Hello all,
Might be a rookie question but I am wondering how to do FOIL multiplication with complex numbers. This far I've managed to get something displaying a polynomial As^4 + Bs^3 + Cs^2 + ... , however all coefficients are complex numbers and I would like the imaginary components of these to cancel out as they do when performing this by hand.
Even a point in the right direction would be appreciated!

 채택된 답변

madhan ravi
madhan ravi 2018년 10월 12일
편집: madhan ravi 2018년 10월 12일

0 개 추천

clear all %an example
syms x
polynomial=i*x-x.^2 %i indicates imaginary number
a = coeffs(polynomial)
real(a)

댓글 수: 2

Worked like a charm, thank you so much!
madhan ravi
madhan ravi 2018년 10월 13일
you're welcome :)

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

추가 답변 (0개)

카테고리

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

질문:

2018년 10월 12일

댓글:

2018년 10월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by