Hi,
i have a time series of monthly means for 46 years. its a univariate time series. i have shifted it to a timetable of size 557×1. since dat is from Jan 1971 – May 2017. it is attached here with.
i need to calculate the standard deviation for each month, using all the yeas in the data. my idea is to reshape the timetable so as to show years in rows and months in columns. so i tried to reshape this timetable to 46X12 sized timetable by using the following code, after wards, the resultant timetable 'A' woulld have 12 columns for each year. thus for each column of month , standard devviation may then be calculated.
but i am getting an error. please correct me, if i am wrong? or any better solution is also appreciated.
thanks in advance Sir.
monthlymeans_ObsData=retime(ObservedData,'monthly',@nanmean); x = monthlymeans_ObsData.timmendorf_time;A = reshape(monthlymeans_ObsData,46,12); %% i get the following error % Error using tabular/reshape (line 155)
% Undefined function 'reshape' for input arguments of type 'timetable'.
mean_y = nanmean(A);A_std = nanstd(A);plot(x, mean_y, 'b', x, mean_y + A_std, 'r',x, mean_y - A_std, 'g');
Best Answer