Write a function named solveSystem that has three inputs: %two vectors % consist
ID: 642586 • Letter: W
Question
Write a function named solveSystem that
has three inputs: %two vectors
% consisting of the coefficients [a b c] of two line equations of the form ax + by = c and a vector of x values
% a. The function should output a vector giving the x and y values of the point of intersection between the two lines. If the lines are parallel, return the empty vector.
% b. Your function should also plot the two lines using the inputted vector of x values as x. In addition, on the same graph, plot the intersection point of the two lines. Make the first line blue, the second line red, and the intersection point a magenta diamond.
% Make sure that you label your plot appropriately
solveSystem(rand(1,3)*2-1, rand(1,3)*2-1, [-5 5])
end
function V = solveSystem(v1, v2, x)
% to solve for the intersection of lines a1x + b1y + c1 = 0
% [a1 b1 * x = -c1
% a2 b2] y -c2
USE MATLAB TO WRITE THE SCRIPT
Explanation / Answer
a)
to get intersectin point...
which would compute for
the matrices
2)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.