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

1 次查看(过去 30 天)
I would like to get the average of an array without considering the last element of the array.
Thanks in advance.

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by