0
votes

I have these two equations:

y1=a*(10/11- (3*i)/4) + b*(5/6+ (7*i)/5)
y2= -1+(j*2) 

where: y1=y2 , And I want to find the exact value of "a" and "b" using only MATLAB.

Is there any MATLAB command I should use to solve these two equations??

p.s.: I tried to use solve command, but it doesn't give me any answer:

syms a b
y1=a*(10/11- (3*i)/4) + b*(5/6+ (7*i)/5);
y2= -1+(j*2);
s=solve('y1-y2=0',[a b])

It gives me this:

Warning: Explicit solution could not be found. 
> In solve at 160 

s =

[ empty sym ]
2

2 Answers

1
votes

First, make sure you wrote your equations properly (operation precedence, parentheses):

in y1, the second and third terms are written weird:

if you simplify (according to what you wrote) it just becomes (45/124)*i + b*(67/30)

Also, why mix i and j in y2 ?

If you did all this well, and you still get the same answer, it really means there is no solution possible.

EDIT:

And looking at this again, you don't have a 2 equation / 2 variable system, you have 3 variables (y,a,b)... which means you can't solve.

EDIT 2:

From the last comment: well just do what you say you want to do, equalize the real and imaginary part of both equations:

syms a;
S = solve('a*(10/11)+b*(5/6)=-1','a*(3/4)+b*(7/5)=2');
S = [S.a S.b]

S =

[-4048/855, 226/57]
-1
votes
>> syms a b
>> solve( a*(10/11- (3*i)/4) + (3/4*i+ ((12)/(31*i))) + b*(5/6+ (7*i)/5i)==-1+(j*2))
a*(- 300/737 + (45*i)/134) - 30/67 + (3045*i)/4154

See official doc.