# I want to plot F(x) and G(x) in same graph for x=(-10,10) how can I do this?

5 visualizzazioni (ultimi 30 giorni)
Arkesh Patel il 22 Feb 2018
Commentato: Roger Stafford il 23 Feb 2018
f(x)=5x^2+9x+2
G(x)=3x+12
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
James Tursa il 22 Feb 2018
Modificato: James Tursa il 22 Feb 2018
What have you done so far? What specific problems are you having with your code? Do you know how to evaluate polynomials for a vector input? Do you know how to plot?

Accedi per commentare.

### Risposte (2)

Star Strider il 23 Feb 2018
See the documentation on Anonymous Functions (link) and the linspace (link) function.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Roger Stafford il 23 Feb 2018
x = linspace(-10,10);
f = 5*x.^2+9*x+2;
G = 3*x+12;
plot(x,f,'r-',x,G,'g-')
##### 2 CommentiMostra NessunoNascondi Nessuno
James Tursa il 23 Feb 2018
Roger, this is tagged as homework ...
Roger Stafford il 23 Feb 2018
Oops!

Accedi per commentare.

### Categorie

Scopri di più su 2-D and 3-D Plots 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!

Translated by