Effacer les filtres
Effacer les filtres

Plotting polynomials side by side.

2 vues (au cours des 30 derniers jours)
Tom
Tom le 20 Nov 2012
Hello,
Is it possible to plot two polynomials next to each other as opposed to on top of each other? The problem being they would both need to originally extend from x values from -1 to 1, but then those x values wouldn't be the same when plotted side by side and the graph would change. This is my approach so far:
x = -1:0.1:1;
c = [-5 4 1 7];
y = polyval(c,x);
plot(x,y)
hold on
c2 = [4 -2 1 9 2];
y2 = polyval(c2,x);
plot(x,y2)

Réponse acceptée

Matt J
Matt J le 20 Nov 2012
Modifié(e) : Matt J le 20 Nov 2012
plot(x+someshift,y2)
  1 commentaire
Tom
Tom le 20 Nov 2012
ha! Yeah that's pretty much all it was. Thanks.

Connectez-vous pour commenter.

Plus de réponses (1)

Matt J
Matt J le 20 Nov 2012
Modifié(e) : Matt J le 20 Nov 2012
Why not use SUBPLOT?
  1 commentaire
Tom
Tom le 20 Nov 2012
Ultimately I am trying to create a singular, randomly curved boundary using polynomials.

Connectez-vous pour commenter.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by