How to use the equation y=mx+b

32 vues (au cours des 30 derniers jours)
Adeke Terkumber
Adeke Terkumber le 1 Août 2017
Commenté : Star Strider le 6 Déc 2024
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.

Réponses (1)

Star Strider
Star Strider le 1 Août 2017
x = 0 : 5;
m = 2;
b = 1;
y = m*x + b;
figure(1)
plot(x, y)
grid
axis([0 5 0 12])
  2 commentaires
Wassim
Wassim le 6 Déc 2024
Thank you
Star Strider
Star Strider le 6 Déc 2024
@Wassim — My pleasure!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by