Plotting a linear equation

Hi!
I'm trying to write a function which takes two vectors e.g a=[1;1] and b=[2;1] and plots the solution of
a.'*(x-b)=0 on a 2D plot. So basically, with these values I'm trying to plot m=3-n but I have to write it as a function so that it can take variables. How can I achieve this?
Thanks

2 Comments

You can use the function fplot, as shown here, to plot the equations.
I have read about it but what I'm looking for is to see if it's possible to have a matrix with 2 parametric elements and plot them. I ended up using the elements seperately, solving the equation manually and it works.
x1=0:5;
x2=(a(1)*b(1)+a(2)*b(2)-a(1)*x1)/a(2);
plot(x1,x2)

Sign in to comment.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 30 Sep 2016

Commented:

on 30 Sep 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!