How to get average of an array except considering the last element of the array

3 vues (au cours des 30 derniers jours)
I would like to get the average of an array without considering the last element of the array.
Thanks in advance.

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 2 Fév 2017
Let A - your double array
B = A(:);
out = mean(B(1:end-1));

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by