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 件のコメント

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

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

質問済み:

2016 年 9 月 30 日

コメント済み:

2016 年 9 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by