I have a 20x1 vertical matrix. I want to take the averages of the pairs in order and display them in another matrix. How?
Mostrar comentarios más antiguos
To elaborate. I want to average the first and second numbers, third and fourth numbers, etc.. and display them again in a 10x1 matrix.
Respuesta aceptada
Más respuestas (1)
Honglei Chen
el 28 de Jun. de 2012
Editada: Honglei Chen
el 28 de Jun. de 2012
x = rand(20,1);
y = transpose(mean(reshape(x,2,10)))
Categorías
Más información sobre Data Types 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!