フィルターのクリア

[B,TF] = rmoutliers(A,method) on older MATLAB version (2016) ?

4 ビュー (過去 30 日間)
swathi
swathi 2020 年 8 月 17 日
コメント済み: swathi 2020 年 8 月 17 日
my file size is [12*3]; i am writing without inbuilt function code and i am struct at nonoutlier
in this figure shows my isoutlier ''B'' output ;in that if 1 is present in any one [X,or Y, or Z] of the column remove entire row of [X,Y,Z]
and i was struct at my nonoutliers output matrix is [32*1]
can you help me to get nonoutlier matrix size [8*3]
i need your help,thank you
S = readtable('object.xlsx');
X = S.X;
Y = S.Y;
Z = S.Z;
position = [X Y Z];
TF=median(position);
M_d=mad(position,1);
c=-1/(sqrt(2)*erfcinv(3/2));
smad=c*M_d;
tsmad=3*smad
B=(abs(position-TF)>=tsmad);
outlier = position(B);
nonoutliers = position(~B)

採用された回答

Cris LaPierre
Cris LaPierre 2020 年 8 月 17 日
It is 32x1 because you are using linear indexing. This happens when you index an array with a single index (even though that index may be an array).
3 columns x 12 rows = 36 elements
36 - 4 outliers = 32
If you want an array back, you must supply row and column indeces. Try something like this for the final line of code:
nonoutliers = position(all(~B,2),:)

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by