Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
Leo
Leo le 3 Avr 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

Réponse acceptée

Thomas
Thomas le 3 Avr 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)

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by