Borrar filtros
Borrar filtros

loop for sum and average for specific rows

2 visualizaciones (últimos 30 días)
nada
nada el 28 de Jul. de 2020
Comentada: nada el 29 de Jul. de 2020
Dear All
I have sea level data 300*1, it is monthly data for 25 years, the data in Excel file
Describing the row (1 JAN, 2 Feb, 3 Mar........ 12 Dec, 13 JAN, 14 Feb, 15 Mar............ 300 Dec )
I want to use a loop to work (sum and average each month) and the final result will be 12*1
Many Thanks in advance

Respuesta aceptada

KSSV
KSSV el 28 de Jul. de 2020
A = rand(300,1) ;
B = reshape(A,12,[]) ;
thesum = sum(B,2) ;
themean = mean(B,2) ;

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by