# Solving cubic equation with imaginary numbers

조회 수: 3(최근 30일)
jayvoor 2022년 12월 2일
댓글: jayvoor 2022년 12월 2일
Hi everyone
I want to solve this equation by multiplying these variables with imaginary numbers and get clear result with s variable and output is in some weird form. What's wrong?
My code below .
clc;
clear;
s1 = 133.9457 + 253.416i
s2 = 133.9457 - 253.416i
s3 = 1339.457
syms s
x = solve(0.00017493*(s-s1)*(s-s2)*(s-s3))

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

### 채택된 답변

Stephan 2022년 12월 2일
편집: Stephan 2022년 12월 2일
s1 = 133.9457 + 253.416i;
s2 = 133.9457 - 253.416i;
s3 = 1339.457;
syms s
x_exactly = solve(0.00017493*(s-s1)*(s-s2)*(s-s3))
x_exactly = x_numeric = double(x_exactly)
x_numeric =
1.0e+03 * 1.3395 + 0.0000i 0.1339 - 0.2534i 0.1339 + 0.2534i
##### 댓글 수: 3표시숨기기 이전 댓글 수: 2
jayvoor 2022년 12월 2일
Thank you very much!! Have a good day sir :)

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

### 범주

Find more on Solver Outputs and Iterative Display in Help Center and File Exchange

R2022b

### Community Treasure Hunt

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

Start Hunting!