MATLAB: Average of 3d matrix 3d matrixaverage hi I have 3D matrix with dimension (61,57,365) the 365 is daily time. I want to do a monthly average overtime to get (61,57,12). But the number of days each month is different. I would be grateful for your help Best Answer #One Waym=cumsum([0,31,28,31,30,31,30,31,31,30,31,30,31]);data=rand(61,57,365); %Sample Datamonth_ave=zeros(1,12)for i=1:12 data1=data(:,:,m(i)+1:m(i+1)); month_ave(i)=mean(data(:));end month_ave Related SolutionsMATLAB: Converting data from minutes to hours >> data_minute = rand(180, 1); % synthetic data>> data_hour = mean(reshape(data_minute, 60, [])) MATLAB: Average of 3d matrix result = reshape(data,61,57,7,39); Data_mean = permute(nanmean(result,3), [1 2 4 3]) %permute gets rid of the singleton dimension that results Related QuestionHow is datevec used on an m*8 matrix in the form [YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, Day of Year, Value]How to i generate monthly sequenceI am working with tthe3 files, and I have csv hourly data for a whole year. I need to get the maximum of a certain value for each month and plot them and also performing addition to another value for each day and getting the max and min dayColumn to multiple row conversionDaily 3d array to monthly- dealing with alternate days in a month and leap years – How to do itMonts in year sequence, string, matrix
Best Answer