How to efficiently plot functions?
Afficher commentaires plus anciens
I have 12 curves I need to plot on a single graph. This is the current script I have where I have manually asked it to plot each curve.
plot(t,y(:,1),t,y(:,2),t,y(:,3),t,y(:,4),t,y(:,5),t,y(:,6),t,y(:,7),t,y(:,8),t,y(:,9),t,y(:,10),t,y(:,11),t,y(:,12))
Is there a way to make this more efficient without having to write out for each 12?
Réponse acceptée
Plus de réponses (1)
Peng Li
le 25 Mar 2020
If t is a vector, you use
plot(t, y);
that will automatically plot each column of y against vector t.
1 commentaire
Ashton Linney
le 25 Mar 2020
Catégories
En savoir plus sur Line Plots dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
