フィルターのクリア

Using the findpeaks function with threshold

36 ビュー (過去 30 日間)
INDS
INDS 2020 年 1 月 12 日
編集済み: Devineni Aslesha 2020 年 1 月 14 日
ECG=load('ECG.csv');
f_s=350;
N=length(ECG);
t=[0:N-1]/f_s;
[pks,locs] = findpeaks(ECG,'MinPeakHeight',threshold)
plot(t,ECG,t(locs),pks,'.')
I want to find the peaks of my ECG trace using findpeaks but I am unsure of how to use the function. I have tried using this code and changing threshold to a value. Is there a way of having it inputted by the user?
I would also like these peaks to be stored as a 1D vector. I was wondering if anyone could help out with the code!
Kind regards

回答 (1 件)

Devineni Aslesha
Devineni Aslesha 2020 年 1 月 14 日
編集済み: Devineni Aslesha 2020 年 1 月 14 日
The threshold value can be inputted by the user as shown below.
prompt = 'What is the threshold value? ';
threshold = input(prompt);
The syntax ‘[pks,locs] = findpeaks(ECG,'MinPeakHeight',threshold)’ stores the peaks above threshold value as a 1D vector in the variable ‘pks’.
For more information, refer the following link:

カテゴリ

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