While Loop help, homework, ADC readings

조회 수: 1 (최근 30일)
Tyler Young
Tyler Young 2020년 2월 4일
댓글: Tyler Young 2020년 2월 5일
I am lost on this one, I understand this requires a while loop and thats about it... screen shot of the question above

채택된 답변

David Hill
David Hill 2020년 2월 4일
There are various ways to determine the start and stop indexes of the clock signal.
clock=clock(clock>4.9);%changes clock signal to 1's and 0's
a=find(clock);%finds indexes of 1's
b=find(diff(a)>1);%finds index of a at the end of the signal
ADC1=mean(signal(a(1:b(1))));
ADC2=mean(signal(a(b(1)+1:b(2))));
ADC3=mean(signal(a(b(2)+1:end)));
There are other ways you can investigate, but you get the idea. Bottom line is that you will need to find the idexes of the start and stop of the clock high signal and then index into signal at those indexes to calculate the means.
  댓글 수: 1
Tyler Young
Tyler Young 2020년 2월 5일
Thank you very much, still going to take some time to understand this fluently, but this is a great help.

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

추가 답변 (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