# MATLAB: How to compute the mean amplitude of each frequency across trials

across trialsamplitudefftfrequencymean

This is probably so easy but I can't get it. After doing a fourier transform (the data matrix is trials x time so I think I do a fft in the column dimension), I first compute (for each trial) the amplitude of each frequency based on the Fourier transformed data, what I've done so far is below. It gives me a 1×450 vector.
``Data=fft(data,[],2);Dataamp = abs(Data)/n;Dataamp = 2*Dataamp(1:n_cutoff); % scales the amps and cuts off at NyquistDataamp(1) = Dataamp(1)/2; % not to scale the first term``
But I now need to calculate (and later plot) the mean amplitude of each frequency across trials and would have thought I need to get the mean across each row, as in a column vector, but besides using the mean function (which only gives a single value as Dataamp is now a vector and I need multiple values) I don't know how else to think about it / go about it? i.e. what am I doing wrong?

``Dataamp = 2*Dataamp(:,1:n_cutoff) % scales the amps and cuts off at NyquistDataamp(:,1) = Dataamp(:,1)/2; % not to scale the first termMeanamp = mean(Dataamp);``
``Dataamp(:,n_cutoff) = Dataamp(:,n_cutoff)/2; % not nyquist either``