Azzera filtri
Azzera filtri

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

3 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Thomas
Thomas il 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)

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by