plotting using semilogy in a loop

10 Ansichten (letzte 30 Tage)
James Connor
James Connor am 1 Dez. 2015
Beantwortet: dpb am 1 Dez. 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.

Antworten (1)

dpb
dpb am 1 Dez. 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)...

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by