MATLAB Answers

How to store the [pks,locs] into a matrix, from a looping?

1 view (last 30 days)
Ana Bianco
Ana Bianco on 18 Sep 2019
Hi all, I'm trying to find natural frequencies, from some FRF's I have.
I already extracted the absolute values of the FRF's (they were in imaginary and real numbers), and I have ploted some graphs, with the frequency vector on the x axis.
Here are the data:
absolutevalues(800x270) - 270 points measured with 800 samples.
Fv = linspace(0,8,size(absolutevalues,1))*1000 ---- the frequency sample is 8000Hz
Trying to find the natural frequencies (peaks) I did this (for only 40 peaks):
peakValues = zeros(40,270);
for m = 1: size(absolutevalues,2)
pks(40,m) = findpeaks(absolutevalues(:,m), Fv, 'NPeaks', 40);
peakValues(:, m) = pks (40,m);
end
The problem is: it only gives me back the peak values for the last value of m (270). How can I store them in this peakValues matrix I created?
Thank you in advance!

  0 Comments

Sign in to comment.

Answers (0)

Sign in to answer this question.