How can I plot a line with just a slope

15 ビュー (過去 30 日間)
redlush
redlush 2019 年 2 月 26 日
回答済み: Yasasvi Harish Kumar 2019 年 2 月 26 日
I would like to plot a line with slope m = 3.374933333e-6
With a domain of x = [0:10:90]
And a range of y = [-0.9995:0.0001:1.0005]
Also I need the line to have an intercept of y = (0,1)
Thanks

回答 (1 件)

Yasasvi Harish Kumar
Yasasvi Harish Kumar 2019 年 2 月 26 日
Hi,
So, you can write the equation of the line as y = m*x+c. m = 3.374933333e-6, c = 1.
m = 3.374933333e-6;
c = 1;
x = 0:10:90;
y = m.*x + c;
plot(x,y)
Something like this should help you.
Regards

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by