Hi guys I want to ask something I am new here. how can I plot the function f= x2 between the numbers -5 and 5
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Waleed Alrabghi
il 11 Feb 2016
Commentato: Star Strider
il 11 Feb 2016
Hi guys I want to ask something I am new here. how can I plot the function f= x2 between the numbers -5 and 5
0 Commenti
Risposta accettata
Star Strider
il 11 Feb 2016
I’m not certain what you want, but one of these should work:
x = linspace(-5,5);
f1 = x*2;
f2 = x.^2;
figure(1)
subplot(2,1,1)
plot(x, f1)
title('f(x) = x\cdot2')
grid
subplot(2,1,2)
plot(x, f2)
title('f(x) = x^2')
grid
0 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!