Code explanation, working with logical variables

조회 수: 5 (최근 30일)
terance
terance 2013년 3월 30일
Would you be so kind to clarify the following Matlab code:
I= (thresh-r)<0;
IU=[~1;I(1:end-1) & ~I(2:end)];
?
where
thresh is the predetermined constant;
I don't understand what does the following line mean:
IU=[~1;I(1:end-1) & ~I(2:end)];

답변 (1개)

Image Analyst
Image Analyst 2013년 3월 30일
It's ANDing a binary signal with the same binary signal shifted one over. In essence, it appears to produce a "true" where there are two or more values of "r" in a row that are above the threshold.

카테고리

Help CenterFile Exchange에서 Frequency-Domain Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by