フィルターのクリア

How to replace some elements of matrix with zero

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

回答 (1 件)

the cyclist
the cyclist 2016 年 2 月 10 日
notPeakLoc = setxor(loc,1:256);
hh2(notPeakLoc) = 0;
  2 件のコメント
Fateme Jalali
Fateme Jalali 2016 年 2 月 10 日
thank you so much
Image Analyst
Image Analyst 2016 年 2 月 10 日
Maybe you could Vote for and Accept his answer to give him "credit" (reputation points) for it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeArgument Definitions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by