필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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

답변 (1개)

Stephan
Stephan 2020년 11월 2일
Consider A is your 492x1 matrix:
B = reshape(A,12,[]);
MyMean = mean(B(6:8,:))

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by