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

1 visualización (últimos 30 días)
I would like to get the average of an array without considering the last element of the array.
Thanks in advance.

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by