How to replace some elements of matrix with zero
1 次查看(过去 30 天)
显示 更早的评论
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);
0 个评论
回答(1 个)
the cyclist
2016-2-10
notPeakLoc = setxor(loc,1:256);
hh2(notPeakLoc) = 0;
2 个评论
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 Exchange 中查找有关 Discrete Data Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!