if any a can be index?

2 次查看(过去 30 天)
Da'Moon
Da'Moon 2017-12-5
编辑: Da'Moon 2017-12-5

采纳的回答

Image Analyst
Image Analyst 2017-12-5
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 个评论
Da'Moon
Da'Moon 2017-12-5
you are correct!
Da'Moon
Da'Moon 2017-12-5
thank you it seems its working now!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by