Calculating the averages of different groups of values
Mostrar comentarios más antiguos
Hi,
I need to get averages of Ys, corresponds to similar groups of Xs separately, without combining the similar groups at two different places. What I mean is, the values of Ys (1,2,4) for the first set of X=3 should not combine with 10 which is Y for X=3 at the end.
Consider two vectors are as follows. Also, it is better if you do not use 'accumarray' command.
x=[3 3 3 4 4 5 5 5 5 3 11];
y=[1 2 4 5 7 1 1 8 10 10 1];
Thanks a lot.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!