Borrar filtros
Borrar filtros

if any a can be index?

2 visualizaciones (últimos 30 días)
Da'Moon
Da'Moon el 5 de Dic. de 2017
Editada: Da'Moon el 5 de Dic. de 2017

Respuesta aceptada

Image Analyst
Image Analyst el 5 de Dic. de 2017
Perhaps this:
VV=8;
v=length(y);
n=0;
for k=1:VV:length(y)
n = n + 1;
if any(y(k:k+8))
A(n)=1;
else
A(n)=0;
end
end
By the way, are you sure you don't want k:(k+7) instead of k:k+8?
  2 comentarios
Da'Moon
Da'Moon el 5 de Dic. de 2017
you are correct!
Da'Moon
Da'Moon el 5 de Dic. de 2017
thank you it seems its working now!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing 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