How to test the difference between 2 groups of 2D matrix?

5 views (last 30 days)
Hi there, I have 2 groups of 2D matrix, which stand for two groups of points in 2D coordinate,i.e.
group1:[x1,y1],[x2,y2],[x3,y3]...
group2:[x'1,y'1],[x'2,y'2],[x'3,y'3]...
I want to test whether these two groups of data have a significant difference, could anyone tell me which method I should choose, thanks a lot!

Answers (2)

Star Strider
Star Strider on 23 Jul 2016
If you have R2015a or later, the ismembertol function would be my choice, because if your values are floating-point, you will need to include a tolerance value.
If you are talking about a statistical significance between them, and your know they are normally distributed, one of the t-test functions would likely work.
If you want to use non-parametric statistics, the Wilcoxon ranksum or signrank tests would likely be best.
All the statistical tests are in the Statistics and Machine Learning Toolbox.
  6 Comments

Sign in to comment.


Image Analyst
Image Analyst on 23 Jul 2016
Edited: Image Analyst on 23 Jul 2016
It would help if we had more context. For example, if they are two closed contours - perimeters around some shapes - and you want to see how well they compare, some people look at the non-overlapped area, and sometimes normalize it to the area of one of the blobs or the average of the two areas. So you could use poly2mask() to turn them into masks and count the non-overlapped pixels
mask1 = poly2mask(x1, y1, rows, columns);
mask2 = poly2mask(x2, y2, rows, columns);
nonOverlappedPixels = xor(mask1, mask2);
numNonOverlappedPixels = sum(nonOverlappedPixels(:));
percentMisMatch = 100 * numNonOverlappedPixels / mean([sum(mask1(:)), sum(mask2(:))]);
  3 Comments
Image Analyst
Image Analyst on 24 Jul 2016
Try the "Classification Learner" app on the Apps tab of the tool ribbon. From there you can try a bunch of different classification methods such as kmeans, SVM, Bayesian, etc. Try several of them with a wide range of your data and see which one works the best.
Weiqian Jiang
Weiqian Jiang on 24 Jul 2016
Sorry but I cannot find the tool ribbon in this website, could you please tell me where I can find this "classification learner"?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!