Calculate mean and st dev from hist weather data
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I have hourly weather data for every year from 2000-2013. Please see attached for the weather data format.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/159942/image.png)
I would like to determine the mean as well as st dev values for every hour!
Can you please support?
best
댓글 수: 0
답변 (1개)
Star Strider
2016년 4월 3일
Maybe I’m missing something in your description, but with one scalar value for each hour, the mean is that value, and the standard deviation is 0 by definition.
댓글 수: 2
Star Strider
2016년 4월 3일
I have to imagine what your data look like, so I created a column vector of 13 years of hourly wind data, then reshaped it to a 24-row matrix, and took the statistics along the rows:
WindSpeed = randi(40, fix(365.25*13)*24, 1); % Create Wind Speed Data As One Column Vector (No Missing Data)
WindSpeed_Hrs = reshape(WindSpeed, 24, []); % Matrix (24xN)
WindWpeedMean = mean(WindSpeed_Hrs, 2); % Take Mean By Rows, Across Columns
WindWpeedStDv = std(WindSpeed_Hrs, [], 2); % Take Mean By Rows, Across Columns
참고 항목
카테고리
Help Center 및 File Exchange에서 Weather and Atmospheric Science에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!