I have two disimilar sized arrays, M1 (37988x5) and M2 (37376x5). The first four column shows year,month,day and hour and the last column show the value at each hour. I want to horizontally concatenate these two arrays based on time dimension. But since M2 has some days missing, which is in M1, I want to fill these values with Nan. So resulting matrix I need is 37988x7. The format of resulting array would be:
<Year> <Month> <Day> <hour> <last col of M1> <last col. of M2> <mean of last col. of M1 and M2>
I know I can create a time table array from both M1 and M2 but not sure how to horizontally concatenate two dismilar arrays together and compute average based on the values of M1 and M2. Since M2 doesn't contain some of the days, I want to fill 'nan' for those rows while computing the average.