plotting using semilogy in a loop

10 visualizaciones (últimos 30 días)
James Connor
James Connor el 1 de Dic. de 2015
Respondida: dpb el 1 de Dic. de 2015
say I have
s= 0.604098184248020 0.642263089970519 3.73235669061904 0.147329697780077 0.238159152322172 0.0172071450520552 0.00180492811644228
the values for s are going to change each time my loop gets called. How do I plot them using semilogy() in which the x-axis is the number of values in s, this case the number is 7. And have it work so on the next call of semilogy in my loop it plots new values of s on the same figure.

Respuestas (1)

dpb
dpb el 1 de Dic. de 2015
See
doc hold
Set
hold on
after the first iteration and add the subsequent lines. You'll want to cycle the color to distinguish the lines (altho seems like maybe I saw one change in later versions is that the color property isn't reset with hold any longer???? You can check easily enough)...

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by