フィルターのクリア

How to use filloutliers for only positive numbers of a data array?

7 ビュー (過去 30 日間)
taimour sadiq
taimour sadiq 2020 年 11 月 20 日
コメント済み: Ameer Hamza 2020 年 11 月 20 日
so if data is stored in Variable 'a'
a = [ 2 1 23 -1 2 5 -36 6 -1]
so it should perform filloutliers only on positve number
when i use b = filloutlier(a) it repalces both '23' and '-36' but i wish it should only perform functionallity on positve number that is '23' and ignore negative numbers.
one method is to filter the data and stored them in a seperate variable or secondly we can remove negative values but because variable 'a' is accessed on many occasions in code so want to perform this on variable 'a' instead of a new variable,
Lets say if i do a(a<0) = 0,
then b = filloutlier(a,'Linear');
it give filloutlier of only positive numbers but my orignal data is change..
kindly suggest a solution... if i again summarize my question basically i want to remove only positve peaks in my data...

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 20 日
Try this
a = [ 2 1 23 -1 2 5 -36 6 -1]
a(a>0) = filloutliers(a(a>0),'Linear')
  2 件のコメント
taimour sadiq
taimour sadiq 2020 年 11 月 20 日
Thanks Ameer...
Ameer Hamza
Ameer Hamza 2020 年 11 月 20 日
I am glad to be of help!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by