Search code examples
matlabwaveform

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

Solution

  • You can average over a single dimension.

    AverageForm = mean(allWaves, 2);