Hi Everyone,
I am trying to solve these 2 equation simultaneously, Dx+4y=2, Dx+2y=4 for 2 values of D which are 1 and 3. I have written the code but it only gives 1 value. Help will be great. Thanks
>> D=[1 2];
for k=1:length(D)
Z=solve([D(k)*x+4*y==2,D(k)*x+2*y==4],[x,y])
end
Z =
x: [1x1 sym] y: [1x1 sym]
Z =
x: [1x1 sym] y: [1x1 sym]
>> Z.x
ans =
3
Best Answer