MATLAB Answers

Converting hourly arrays to daily

2 views (last 30 days)
Behzad Navidi
Behzad Navidi on 24 Mar 2020
Answered: Ameer Hamza on 24 Mar 2020
Hey all, I hope you are well!
I have a 31 x 1 cell which includes 3D arrays (81x69x8760 or 8784 in leap years); The 81 is longitude, the 69 is latitude, and 8760 or 8784 is hours in a year. I want to change hourly to daily (using mean) scale (81x69x365 or 366 in case of 8784), but there is a little bit of complexity that I can't handle it.
I want to ignore the first hour in the first array, and use the first hour in all other arrays as the last hour in the previous array, and finally, I don't need the last array (31st), in fact, I just keep it for use it first hour as last hour in previous (30th) array.
So the results that I need are a 30x1 cell with 81x69x365 or 366 (in leap years) arrays.
As the file is too large to attach I just attach a 2x1 cell as a test.
I would be grateful if you can help me with this issue.
Best Regards.

  0 Comments

Sign in to comment.

Accepted Answer

Ameer Hamza
Ameer Hamza on 24 Mar 2020
There is some issue with the mat file you attached. It appears to be blank when opened in MATLAB R2020a. You can use the retime function to change the interval from hourly to daily: https://www.mathworks.com/help/matlab/ref/timetable.retime.html

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Products


Release

R2018b