I have plotted a few graphs in different sections of my scripts, however when I run the m-file it will only show the last graph, I have to run it section by section in order to get all the graphs. How can I get all the graphs after I hit the run button? p.s. I am new to matlab so please explain with simple language, thank you for the help!

 Réponse acceptée

Star Strider
Star Strider le 8 Oct 2016

40 votes

Specify each plot as a separate figure. I number mine, but that’s not absolutely necessary. See the documentation for the figure function for details.
Example:
figure(1)
plot(a,b)
grid
figure(2)
plot(c,d)
grid

4 commentaires

Pedro Rocha
Pedro Rocha le 19 Août 2020
Excelent!! Tks
Salima Ljamai
Salima Ljamai le 17 Sep 2020
Thank you.
Star Strider
Star Strider le 18 Sep 2020
Thank you!
My pleasure!
Jurek
Jurek le 20 Mar 2025
Cheers person from 5 years ago

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by