average of each two vectors of a matrix
Mostrar comentarios más antiguos
I have a matrix of n*n for example 10*5
x=rand(10,5)
Then I want to get the average of each two row. For example the first two row (each element ) etc
I will have a matrix of 5*5 after that
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 9 de Oct. de 2014
Editada: Azzi Abdelmalek
el 9 de Oct. de 2014
a=reshape(mean(permute(reshape(x',5,2,[]),[2 1 3])),5,5)'
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!