フィルターのクリア

How to filter data using rmoutliers?

4 ビュー (過去 30 日間)
Star Rats
Star Rats 2019 年 10 月 8 日
編集済み: Star Rats 2020 年 1 月 13 日
To remove data above 1.2 and below -1.2.
I use:
threshold = [-1.2, 1.2];
y = rmoutliers(y,'percentiles',threshold);
But error occurred:
Error using isoutlier>parseinput (line 236)
'Percentiles' value must be a sorted 2-element numeric vector with entries between 0 and 100.
Any other functions which can be used to solve the problem?

回答 (1 件)

Daniel M
Daniel M 2019 年 10 月 8 日
If you have a hard threshold you want to use, then rmoutliers is not the function you want. Just use a simple logical index to get the location of the outliers, then you can do what you want with them.
locs = abs(y)>=1.2;
% locs = find(abs(y)>=1.2); % if having the indices is easier than a logical index
You can chose whether to remove those data points, set them to the threshold value, etc.

カテゴリ

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