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

1 visualizzazione (ultimi 30 giorni)
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!

Risposte (1)

Abhishek Gupta
Abhishek Gupta il 16 Dic 2020

Prodotti


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by