フィルターのクリア

How to replace all elements of matrix with zero except some elements(localpeaks?

2 ビュー (過去 30 日間)
Fateme Jalali
Fateme Jalali 2016 年 2 月 10 日
コメント済み: Fateme Jalali 2016 年 2 月 10 日
Hello,I have a matrix of data with size 1*256. I found local peaks using [pks loc]=findpeaks(hh2) ;now in my matrix i want to put zero instead of all elements except peaks that i found.can any one help me plz?

回答 (1 件)

Christopher  Davis
Christopher Davis 2016 年 2 月 10 日
I would try something like this:
x=1:length(hh2);
x(loc)=[];
hh2(x)=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