Effacer les filtres
Effacer les filtres

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

4 vues (au cours des 30 derniers jours)
swathi
swathi le 17 Août 2020
Commenté : swathi le 17 Août 2020
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)

Réponse acceptée

Cris LaPierre
Cris LaPierre le 17 Août 2020
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),:)

Plus de réponses (0)

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by