Help with matrix manipulation in matlab

1 Ansicht (letzte 30 Tage)
aurc89
aurc89 am 9 Sep. 2014
Kommentiert: aurc89 am 9 Sep. 2014
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!

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 9 Sep. 2014
Bearbeitet: Andrei Bobrov am 9 Sep. 2014
out = squeeze(mean(reshape(M,3,[],size(M,2))));

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by