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!