Create a program to graph and solve 2 simultaneous linear eq

Create a program to graph and solve 2 simultaneous linear equations ax +by c where the user inputs scalars: a, b, c, d, e, f.

Solution

prompt = \'Enter the value of a \';

a = input(prompt)

prompt1 = \'Enter the value of b \';

b = input(prompt1)

prompt2 = \'Enter the value of c \';

c = input(prompt2)

prompt3 = \'Enter the value of d \';

d = input(prompt3)

prompt4 = \'Enter the value of e \';

e = input(prompt4)

prompt5 = \'Enter the value of f \';

f = input(prompt5)

determinant = (a*f) -(b*d);

disp (\'Deterimnant of the liner equation is : \')

disp (determinant);

A = [a b;d e];

b = [c f];

disp (\'X & Y value of the eqation is \')

x=A/b

y1 = ((-b/a)*x + (c/a));

y2 = ((-e/d)*x + (f/d));

figure

subplot(2,1,1)

plot(x,y1)

title(\'Subplot 1\')

subplot(2,1,2)

plot(x,y2)

title(\'Subplot 2\')

 Create a program to graph and solve 2 simultaneous linear equations ax +by c where the user inputs scalars: a, b, c, d, e, f. Solutionprompt = \'Enter the valu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site