Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Thomas
Thomas el 3 de Abr. de 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)

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by