Maximum value from data
Show older comments
Hey guys,
i have a problem with the maxk and findpeaks function from matlab. I have a dataset with thousands of items and I want to display the 25 largest items in the order they appear in the dataset. First i used the maxk function to get the 25 highest values. so far so good i got my 25 values but in the wrong order. Then i tried to use the findpeaks function on my outgoing dataset and used for the 'MinPeakHeight' the lowest value from the maxk funtion. But in the end I did not have 25 items but only 22. What did i wrong?
n = 25;
Peaks = Output.Results_interval_analysis.Untitled.max_abs_in_V;
n_Peaks = maxk(Peaks,n);
% so here i got my 25 values from high to low
[pks_Peaks, locs_Peaks] = findpeaks(Peaks,'MinPeakHeight',n_Peaks(1, n))
% after this step i only got 22 values
Accepted Answer
More Answers (0)
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!