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 commentaires

Eamon
Eamon le 30 Sep 2016
You can use the function fplot, as shown here, to plot the equations.
ssulun
ssulun le 30 Sep 2016
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)

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Question posée :

le 30 Sep 2016

Commenté :

le 30 Sep 2016

Community Treasure Hunt

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

Start Hunting!

Translated by