Average vector of an array
Afficher commentaires plus anciens
So if I have a 6x2 array, lets say:
[0 0 0 0 0 0]' and [2 2 2 2 2 2]'
how do I use matlab to find an average vector of these vectors so that it returns for example [1 1 1 1 1 1]'?
Réponses (2)
Ameer Hamza
le 22 Nov 2020
You can specify the dimension in mean() function. For example
x = [0 2;
0 2;
0 2;
0 2;
0 2;
0 2];
y = mean(x, 2)
1 commentaire
Karim ElShorbagi
le 22 Nov 2020
dpb
le 22 Nov 2020
0 votes
https://www.mathworks.com/help/matlab/ref/mean.html Look at first example
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!