Ave3ON(i)=mean(M3(90000-S(i).date*1667:90000));
Ave5ON(i)=mean(M5(90000-S(i).date*1667:90000));
Ave7ON(i)=mean(M7(90000-S(i).date*1667:90000));
AvethdON(i)=mean(Mthd(90000-S(i).date*1667:90000));
Okay, parallel indices into 4 different arrays. Makes sense.
Ave3OFF(i)=mean(M3(110000:110000+S(i).date*1667));
Ave5OFF(i)=mean(M5(110000:110000+S(i).date*1667));
Ave7OFF(i)=mean(M7(110000:110000+S(i).date*1667));
Okay, parallel indices into 3 of the 4 different arrays from above. That's odd, I wonder why the 4th array isn't being used?
AvethdOFF(i)=mean(thd(110000:110000+S(i).date*1667))
The destination location parallels the block of 4 above, and the code structure parallels the three lines above it, but why have you suddenly switched from indexing an array named Mthd, to instead requesting the calculation of Total Harmonic Distortion (thd) ?
Best Answer