Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a program to graph and solve 2 simultaneous linear equations: ax +by c dx

ID: 3785129 • Letter: C

Question

Create a program to graph and solve 2 simultaneous linear equations: ax +by c dx +ey -f where the user inputs scalars: a, b, c, d, e, f. Students should create a script (named Lab3xxx.m where xxx-student's initials) that accomplishes the tasks specified below. 1. Put a comment block at the top of your script file that contains your full name, the date this lab is due, the lab and a brief description of what your script does. 2. Issue commands at the top of the script to clear variables & the command window before the rest of the script starts to execute. 3. Display information to the user (using disp command) about what this program does. 4. Ask the user to input scalars: a, b, c, d, e, f Create a clean, informative user interface. 5. Display the determinant (and explain it to the user). 6. Generate a graph showing both lines. Please include a title with your full name, x-axis and y-axis labels on your graph. 7. Solve for x and display that solution to the user. 8. Solve for y and display that solution to the user. Students should test their script as follows: 1. Try the same 2 problem sets as assigned in the last class: 1.5 X 3 .5 X 5 X 2 .5 X 2. Try a new set:

Explanation / Answer

clear all;

close all;

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));

if determinant == 0

disp ('No intersection exist')

end

figure

subplot(2,1,1)

plot(x,y1)

title('Subplot 1')

subplot(2,1,2)

plot(x,y2)

title('Subplot 2')

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote