Making two peaks into one
Show older comments
Hi
How can I make two peaking values into the highest.
I have these vectors (one double and one duration) showing the duration of the peaks (when the curve crosses the red threshold).
However some peaks have two peak values, making the double vector one element bigger than the duration vector. I want the vectors to be of the same length so only the highest peaking value of each peak show. So in this case row 9 of the max_val should be removed.
EFFEKT= 8760x1 double %One value for every hour of the year
Abonnemang=24200; %threshold value
t=8760x1 datetime %Every hour of the year
[max_val,locs] = findpeaks(EFFEKT,'MinPeakHeight',Abonnemang); % find the peak and its x axis location
[t0_pos1,s0_pos1,t0_neg1,s0_neg1]= crossing_V7(EFFEKT,t,Abonnemang,'linear'); % positive (pos) and negative (neg) slope crossing points
peak_width = t0_neg1- t0_pos1;
peak_width =peak_width
peak_width

max_val


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!