plotting using semilogy in a loop

6 次查看(过去 30 天)
James Connor
James Connor 2015-12-1
回答: dpb 2015-12-1
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.

回答(1 个)

dpb
dpb 2015-12-1
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)...

类别

Help CenterFile Exchange 中查找有关 Graphics Objects 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by