Borrar filtros
Borrar filtros

How do I take the average of every 50th term in a 2500x1 vector?

1 visualización (últimos 30 días)
I have a 2500x1 vector and I'm trying to find if the average of the average of every 50th term equals the average of all 2500 variables.

Respuesta aceptada

Stalin Samuel
Stalin Samuel el 15 de Sept. de 2017
s=rand(2500,1); %2500x1 vector
Out1=mean(reshape(s,[50 50])); %mean of every 50 values
out2=mean(s(50:50:2500)) % mean of every 50th value

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by