Using mean function
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, I am new to matlab and I try to find a solution to a simple problem I have.
I have a column of values and I want to calculate mean values with a certain step, e.g. calculate the mean of values 1-6, then the mean of values 7-12 etc ...
Can someone please give any ideas on how to do this?
Thank you, George
0 commentaires
Réponse acceptée
Teja Muppirala
le 28 Mai 2011
The reshape command can help to implement this:
X = rand(18,1)
Y = reshape(X,6,[])
mean(Y)
or more simply, just:
mean(reshape(X,6,[]))
0 commentaires
Plus de réponses (2)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!