How can I compute the mean of an EMG signal that I loaded it in MATLAB?
조회 수: 2 (최근 30일)
이전 댓글 표시
I loaded my signal and now I want to compute the mean and absolut of it, is there any code to do these?
댓글 수: 0
채택된 답변
Image Analyst
2017년 3월 4일
The mean() and abs() functions immediately spring to mind.
댓글 수: 5
Image Analyst
2017년 3월 4일
Why did you think that? Did the practice question specifically say not to use the built-in mean() or sum() functions? If so, you can use a for loop:
theSum = 0;
for k = 1 : length(yourVector)
theSum = theSum + yourVector(k);
end
theMean = theSum / length(yourVector);
Or
theSum = theSum + abs(yourVector(k));
if you want the mean of the absolute value of the signal.
추가 답변 (1개)
ThB
2017년 3월 4일
Just use
meanEMG = mean(EMG);
to compute a simple mean of an array. Or use
meanEMG = mean(mean(EMG));
if its a matrix
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!