필터 지우기
필터 지우기

solve 2 unknowns using one complex equation

조회 수: 1 (최근 30일)
raymond
raymond 2012년 6월 4일
usually, to solve 2 unknowns, it require at least 2 or more equations. but if the equation is complex, then one equation is sufficient since can compare the real and imaginary part. for example
3+2i = (x+2y+1)+(2x-y-3)i
if want to solve for x and y a simple solve function as shown can be written.
T=3+2i;
syms x y;
P=-real(T)+ (x+2*y+1);
Q=-imag(T)+ (2*x-y-3);
R=solve(P,Q);
X=R.x
Y=R.y
I am now trying to tackle a much more complex equation that involves x and y. and its near impossible to separate the terms into real and imaginary part.
so i'm hoping to do something like this
syms x y;
P=-1*real(T)+ real(%a complicated eq relating x&y%);
Q=-1*imag(T)+ imag(%a complicated eq relating x&y%);
R=solve(P,Q);
but i keep getting error. i think the syntax is incorrect. is there a way to get this working? please share your thoughts one this.
any suggestions are highly appreciated.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by