I have a matrix M with dimension 600x500. I want to do an average of its values along vertical direction, in order to have a matrix with smaller dimension. For example, I want to obtain a matrix with dimension 200x500: this means that, every three values along each column, I take just one (which is the average of the three values). How can I do this ? Thanks!

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2014년 9월 9일
편집: Andrei Bobrov 2014년 9월 9일

0 개 추천

out = squeeze(mean(reshape(M,3,[],size(M,2))));

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

질문:

2014년 9월 9일

댓글:

2014년 9월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by