if any a can be index?

조회 수: 1 (최근 30일)
Da'Moon
Da'Moon 2017년 12월 5일
편집: Da'Moon 2017년 12월 5일
  댓글 수: 1
KSSV
KSSV 2017년 12월 5일
What is y?

댓글을 달려면 로그인하십시오.

채택된 답변

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