Calculating Time Between Binary Ticks

조회 수: 3 (최근 30일)
Karam Elabd
Karam Elabd 2017년 11월 20일
편집: Karam Elabd 2017년 11월 20일
Hello,
I am trying to calculate the time between a set of binary ticks to determine the onset of an activity from data provided by a sensor.
The sensor is an optical encoder that fluctuates (or ticks) between 1's and 0's whenever the encoder rotates. My objective is to determine the time between these ticks. The binary value provided by the encoder is of no interest, but rather the rate at which it is revolving.
Here are a couple of examples that may help with my explanation.
encoderArray_Example1 = [1 0 1 0 1 1 1 0 0 0 0 1 0 0 1 1]; %These are binary states timeBetweenTicks_Example1 = [1 1 1 1 3 4 1 2 2]; %The result here is in units of time
encoderArray_Example2 = [1 1 1 0 0 0 0 1 1 0 1 0]; %These are binary states timeBetweenTicks_Example2 = [3 4 2 1 1 1]; %The result here is in units of time
Thanks!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by