Given that you have the code below, how do you write a code to count the number of points in each quadrant with the attached data set

조회 수: 2 (최근 30일)
Classical = pdist2(matrix_logdiff_nsample, mean(matrix_logdiff_nsample),'mahal');
p = size(matrix_logdiff_nsample,2);
chi2quantile = chi2inv(0.99,p);
[SFmcd, MFmcd, Fmcd, OutFmcd] = robustcov(matrix_logdiff_nsample);
plot(Classical, Fmcd, 'o')
line([chi2quantile, chi2quantile], [0, 120], 'color', 'r')
line([0, 80], [chi2quantile, chi2quantile], 'color', 'r')
hold on
plot(Classical(OutFmcd), Fmcd(OutFmcd), 'b*')
xlabel('Mahalanobis Distance')
ylabel('Robust Distance')
title('Distance Plot, Fast MCD method')
  댓글 수: 2
Walter Roberson
Walter Roberson 2020년 7월 12일
For any given point, what are its coordinates based upon the file or variable -- coordinates in the same terms as what is being divided for the purpose of quadrants?
Is the division into quadrants to be based upon half-way through the span of values that appear (mean)? Is it to be based upon median? Is it to be based upon some absolute coordinates (e.g., 0 to 50 and 50 to 100, even if the mean or median might be closer to 70?)

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

답변 (1개)

Walter Roberson
Walter Roberson 2020년 7월 12일
Supposing your two variables are named v1 and v2, then
counts = accumarray([1+(v1(:)>=mean(v1)), 1+(v2(:)>=mean(v2))], 1, [2 2]);

카테고리

Help CenterFile Exchange에서 Frequently-used Algorithms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by