Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
I would like to get the average of an array without considering the last element of the array.
Thanks in advance.

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by