How to plot separate graphs?

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!

 Respuesta aceptada

Star Strider
Star Strider el 8 de Oct. de 2016

40 votos

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 comentarios

Pedro Rocha
Pedro Rocha el 19 de Ag. de 2020
Excelent!! Tks
Salima Ljamai
Salima Ljamai el 17 de Sept. de 2020
Thank you.
Star Strider
Star Strider el 18 de Sept. de 2020
Thank you!
My pleasure!
Jurek
Jurek el 20 de Mzo. de 2025
Cheers person from 5 years ago

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 8 de Oct. de 2016

Comentada:

el 20 de Mzo. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by