How to get max/min temp data from hourly data?
이전 댓글 표시
Hi,
I have a dataset of hourly data for a 30+day period and have no clue where to start to get the daily min and max temperatures for each day of this period? Can anyone help me? Imagine that column1 is the day of year, column 2 is the time, and column 3 is the hourly temp.
채택된 답변
추가 답변 (1개)
JAG2024
2015년 1월 29일
댓글 수: 3
Star Strider
2015년 1월 29일
My pleasure!
The problem with for loops is that they’re inefficient, and aren’t the best option for large problems. The built-in functions are optimised, and in many instances use compiled C-code to do the requisite operations.
One way to generate my ‘Tv24’ matrix with a for loop is:
for k1 = 1:30
ofst = (k1-1)*24 + [1:24];
Tv24(:,k1) = Tv30(ofst);
end
There are likely other variations that would work as well.
Still another option uses the mat2cell function:
Tv24 = mat2cell(Tv30, repmat(24,1,30), 1);
Choose the one that is best for your application.
JAG2024
2015년 1월 30일
Star Strider
2015년 1월 30일
Again, my pleasure!
카테고리
도움말 센터 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!