pac
pac

Reputation: 291

getting mean value of sensor for given runs

given A number of sensor values measured at each of 100 runs.

 A =

 8     7     8     9     8     8     8     8     9     8

to display the value of specific runs (let us say every 5 runs)

the code is:

C= B(1:5:end);

C=  8   8

What I want is to store the average of 5 runs how to do that?

answer should be = 8  8.2

Upvotes: 0

Views: 54

Answers (1)

kol
kol

Reputation: 28718

I don't have Matlab at hand, but I would try something like mean(reshape(B,5,[])).

Upvotes: 1

Related Questions