While Loop help, homework, ADC readings
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Tyler Young
am 4 Feb. 2020
Kommentiert: Tyler Young
am 5 Feb. 2020
I am lost on this one, I understand this requires a while loop and thats about it... screen shot of the question above
0 Kommentare
Akzeptierte Antwort
David Hill
am 4 Feb. 2020
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!