Borrar filtros
Borrar filtros

construct vectors if cycle

2 visualizaciones (últimos 30 días)
joo
joo el 3 de Oct. de 2012
hello!
i need to construct vectors xx and yy. The problem is that at each cycle the past xx and yy is deleted but i want the opposite. i want them to keep the past information and grow at each cycle. what can i do?
i appreciate any help. thank you very much.

Respuestas (1)

Walter Roberson
Walter Roberson el 3 de Oct. de 2012
Before the loop,
xx = [];
yy = [];
Then in the loop, change the xx and yy statements to
xx = [xx, x(iPeaks1:iPeaks2)];
yy = [yy, y(iPeaks1:iPeaks2)];

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by