Borrar filtros
Borrar filtros

How to create a vector?

2 visualizaciones (últimos 30 días)
Ioana Mateescuu
Ioana Mateescuu el 21 de En. de 2019
Comentada: Stephen23 el 22 de En. de 2019
How can I create a vector containing all the k values? Thank you!
beat_count=0;
for k=2:length(val)-1;
if(val(k)>val(k-1)&val(k)>val(k+1)&val(k)>1)
k
disp('Prominant peak found');
beat_count=beat_count+1;
end
end

Respuesta aceptada

Kevin Phung
Kevin Phung el 21 de En. de 2019
v = [];
for k=2:length(val)-1;
if(val(k)>val(k-1)&val(k)>val(k+1)&val(k)>1)
k
disp('Prominant peak found');
beat_count=beat_count+1;
v(end+1) = k % save k value into vector v;
end
end

Más respuestas (0)

Categorías

Más información sobre Curve Fitting Toolbox en Help Center y File Exchange.

Productos


Versión

R2007b

Community Treasure Hunt

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

Start Hunting!

Translated by