Help with matrix manipulation in matlab

2 次查看(过去 30 天)
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
out = squeeze(mean(reshape(M,3,[],size(M,2))));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by