This code identifies significant absolute values within a series and further classifies them as positive or negative. Notably, it selects only the middle value for consecutive large values. For instance, given consecutive large value indices like [6, 7, 8, 9, 10], the algorithm chooses only index [8].
There are two code snippets: 'MAIN_large_values.m' and 'get_large_values.m', along with a dataset 'all_events_array.mat'. To execute the code, place all files in the same folder. Open 'MAIN_large_values.m' and run it from the editor. The resulting plot resembles the one in the avatar, with positive large values indicated by red arrows and negative ones by blue. Notably, for consecutive large values, only the middle one is selected.
To capture every large absolute value, you can modify 'get_large_values.m' as instructed in the comments.
引用格式
Jitong Ding (2025). pick out consecutive large values only once (https://ww2.mathworks.cn/matlabcentral/fileexchange/165886-pick-out-consecutive-large-values-only-once), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2024a
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!