Filter löschen
Filter löschen

Average value of a graph after steady state has been reached.

3 Ansichten (letzte 30 Tage)
Leo
Leo am 3 Apr. 2012
Good afternoon. I have a graph that has an unsteady period for the first second then for the rest of the time period it oscillates steadily. I want to be able to select only the steady part of the graph. Here is a simplification of my code: (assuming that the graph is y vs sin(x) because my function is quite complex, but the principle should be the same)
x=(0:0.1:10); y=sin(x); b1=8; x1=x(b1:end); y1=y(b1:end); figure plot(x1,y1)
so I am trying to plot the values of the graph from x=8 on-wards, which doesn't happen when I enter plot(x1,y1) any help is greatly appreciated. Thanks, Leo

Akzeptierte Antwort

Thomas
Thomas am 3 Apr. 2012
If I understand your question right you want only values for x>=8 and plot y accordingly
x=(0:0.1:10); y=sin(x);
x1=(x(x>=8));
y1=y(numel(y)-numel(x1)+1:end);
plot(x1,y1)

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by