How to use the equation y=mx+b

57 次查看(过去 30 天)
Please fellow users, I remember I had used the expression y=mx+b to plot a straight line graph with y = number and x = number only, values of m and b were not given. I have forgotten the code. can someone help me out of this problem? thank you.

回答(1 个)

Star Strider
Star Strider 2017-8-1
x = 0 : 5;
m = 2;
b = 1;
y = m*x + b;
figure(1)
plot(x, y)
grid
axis([0 5 0 12])

类别

Help CenterFile Exchange 中查找有关 Directed Graphs 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by