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

3 visualizzazioni (ultimi 30 giorni)
I would like to get the average of an array without considering the last element of the array.
Thanks in advance.

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 2 Feb 2017
Let A - your double array
B = A(:);
out = mean(B(1:end-1));

Più risposte (0)

Categorie

Scopri di più su Data Types in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by