Plotting daily mean values of temperature

조회 수: 3 (최근 30일)
Rey
Rey 2019년 11월 10일
댓글: Rey 2019년 11월 11일
I quite new to Matlab. I have a dataset of temperature readings collected at 30 minutes intervals for two years. I would like to plot the daily mean temperatures for this two year period. Can you please advise on how to do this? Thanks
  댓글 수: 2
Steven Lord
Steven Lord 2019년 11월 11일
How is your data stored? A vector of time data and a vector of temperature data, a timetable, or some other arrangement?
Rey
Rey 2019년 11월 11일
The data is stored as a vector of temperature data for the period of Oct 25, 2010 to Sept 01, 2012.

댓글을 달려면 로그인하십시오.

답변 (1개)

Shubham Gupta
Shubham Gupta 2019년 11월 10일
Assuming there are no leap years in this period of time, I think you have a vector of dimesion (35040x1) (2samples*24hrs*365days*2years). If not, please manipulate your data into this dimesion to use the following code :
data_up = reshape(data, 48, 730); % reshape vector, each column is data for 1 day, each row is data sample at 30 min mark on that day
output = mean(data_up,1); % output will be 1x730 vector with each column represent mean of that day
Let me know if you have doubts.
  댓글 수: 1
Rey
Rey 2019년 11월 11일
The data is collected for the period of Oct 25-2010 to Sept 01-2012.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by