How to find the maximum of peaks ?
Show older comments
I want to find the first maximum 4 peaks in loop.My code finds all the peaks,how can I find only 4 and plot them ?
A= load ('ZT2.mat');
figure
for i= 1:1:300
s3= abs(fft( A.A1(:,i)));
subplot (3,2,1)
plot (s3((1:end/2)));
subplot (3,2,2)
[pkSA{i},locSA{i}]=findpeaks(s3);
plot ( (locSA{i}),(pkSA{i}));
title('Peaks ZT1');
drawnow
pause(0.1)
end
Accepted Answer
More Answers (0)
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!