How can I remove outliers of a large matrix where an outlier is defined as a point more than three standard deviations from the mean of each column of the matrix.
I have this code but it works for a single vector, my data is in a matrix form
threshold = 3 * std( BQ);
validRange = mean(BQ) + [-1 1] * threshold;
dataWithoutOutliers = BQ(( data >= validRange(1) & data <= validRange(2) );

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020년 10월 3일

0 개 추천

Use logical indexing.

댓글 수: 3

Kwasi Boateng
Kwasi Boateng 2020년 10월 3일
Please how do I go about it am new to matlab
Kwasi Boateng
Kwasi Boateng 2020년 10월 3일
편집: Kwasi Boateng 2020년 10월 3일
I have this code but it works for a single vector, my data is in a matrix form
threshold = 3 * std( BQ);
validRange = mean(BQ) + [-1 1] * threshold;
dataWithoutOutliers = BQ(( data >= validRange(1) & data <= validRange(2) );
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020년 10월 3일
In this case, you had better employ MATLAB's builtin function to remove outliers. See this help doc:

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

태그

질문:

2020년 10월 3일

댓글:

2020년 10월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by