Classify rows of a matrix
Afficher commentaires plus anciens
Hello
I want to know how it is possible to define a condition as if the numbers at the second column of some rows of a matrix are equal to each other and at the same time if the numbers at the third column of the same rows are equal to each other , then classify the first column numbers of those rows and calculate their mean values...in simple words, consider matrix A as:
A=[0.9 20.1 0.3;
0.8 19 1;
0.57 20.1 0.3;
0.7 20.1 0.4;
1 19 1]
I need a code to calculate the mean value of 0.9 and 0.57 as the numbers in second and third column of row 1 and 3 are the same. It should also calculate the mean of 0.8 and 1 as the numbers in second and third column of row 2 and 5 are the same.
Any help is highly appriciated.
Bests
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!