Clear Filters
Clear Filters

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

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

Accepted Answer

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

More Answers (0)

Categories

Find more on Data Types in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!