how to take the average of 6th 7th and 8th value of a 12x1 matrix and it will continue upto 492x1 matrix

1 visualización (últimos 30 días)
I have a 492x1 matrix. I have to take the average of the 6th 7th and 8th numbers. For better understanding I have 41 years, then I have 492 months. I need to take the average of June July August of every year. I will have 41x1 matrix after computation. Please help

Respuestas (1)

Stephan
Stephan el 2 de Nov. de 2020
Consider A is your 492x1 matrix:
B = reshape(A,12,[]);
MyMean = mean(B(6:8,:))

Categorías

Más información sobre Resizing and Reshaping Matrices 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