Using a boolean operation to assign specific values for each threshold

3 ビュー (過去 30 日間)
mpz
mpz 2022 年 8 月 22 日
コメント済み: mpz 2022 年 8 月 22 日
Hi,
I have a data that has noise in it and I want to convert it using boolean operation assigning specific integers based on the set threshold. So for example, based on the plot below I want to set 4 thresholds corresponding to 150-750, 750-1500, 1500-2250, 2250-3500. Based on these 4 threshold I want to use boolean operation to assign integers that correspond to each threshold. So for any value between
>150 & < 750, I want it to assign and store a 1
>= 750 & < 1500, I want it to assign and store a 2
>= 1500 & < 2250, I want it to assign and store a 3
>= 2250 & < 3500, I want it to assign and store a 4
I will eventually want to sum all the number of 1s, 2s, 3s and 4s to tell me the peaks for each threshold. Using findpeak on this data even when using a filter gives me data I don't need. I rather do it this way. Please any advice is appreciated. See attached data.

採用された回答

Steven Lord
Steven Lord 2022 年 8 月 22 日
Use the discretize function.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by