Doug
Doug

Reputation: 597

averaging waveforms in matlab

I have a matrix that called 'allWaves' that is 32x5000.

Each of the 32 points represents a point on a wave. And there is 5000 waves. I was hoping to get one final averaged waveform.

this is what i've tried, i'm a beginner in Matlab. And I was really hoping to just plot this final wave. Thank you in advance.

finalIndices = [1:length(allWaves)];

for datapoint = 1:length(allWaves(:,1))
     AverageForm = [AverageForm mean(allWaves,finalIndices)];
end

Upvotes: 0

Views: 526

Answers (1)

user1543042
user1543042

Reputation: 3440

You can average over a single dimension.

AverageForm = mean(allWaves, 2);

Upvotes: 1

Related Questions