Systems of Linear Equations Systems of equations using solve command. SYNTAX [x1,x2, ...] = solve(eqn1, eqn2,..) Example: Solve the systems of equation. graph the equations. PROBLEM 1 x + 7y=3

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Can you answer this and send it ASAP I
really need it for my homework

Systems of Linear Equations
Systems of equations using solve command.
SYNTAX
[x1,x2,...] = solve(eqn1, eqn2...)
Example:
Solve the systems of equation. graph the equations.
PROBLEM 1
PROBLEM 2
x+7y=3
2x-5y = 4
Solution:
syms x y x1 x2 x3
%Problem 1
x₁2x₂ + 3x₂=5
3x₁ + 4x₂ - 5x3 = 7
x₁ + 8x₂-11x3 = 2
eqn1 = x+7*y==3;
eqn2 = 2*x-15*y==4;
[Rt1, Rt2] = solve (eqn1, eqn2);
ezplot (eqn1)
hold on
end
grid on
ezplot (eqn2)
if isempty(Rt1)
else
text1 = "The system is inconsistent";
fprintf(text1);
plot (Rt1, Rt2,'*')
text1= "The system is consistent";
fprintf(text1);
hold off
plot (Rt1, Rt2,'*')
text1= "The system is consistent";
fprintf(text1);
hold off
My Solutions >
Transcribed Image Text:Systems of Linear Equations Systems of equations using solve command. SYNTAX [x1,x2,...] = solve(eqn1, eqn2...) Example: Solve the systems of equation. graph the equations. PROBLEM 1 PROBLEM 2 x+7y=3 2x-5y = 4 Solution: syms x y x1 x2 x3 %Problem 1 x₁2x₂ + 3x₂=5 3x₁ + 4x₂ - 5x3 = 7 x₁ + 8x₂-11x3 = 2 eqn1 = x+7*y==3; eqn2 = 2*x-15*y==4; [Rt1, Rt2] = solve (eqn1, eqn2); ezplot (eqn1) hold on end grid on ezplot (eqn2) if isempty(Rt1) else text1 = "The system is inconsistent"; fprintf(text1); plot (Rt1, Rt2,'*') text1= "The system is consistent"; fprintf(text1); hold off plot (Rt1, Rt2,'*') text1= "The system is consistent"; fprintf(text1); hold off My Solutions >
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning