i have 240 files of 3dimension .mat files with 140x122x118
i have obtain the mean of these files using this method (credits to matlab community):
...files=dir('*.mat'); totalfile = numel(files); C = cell(1,totalfile); for a = 1:totalfile T = load(files(a).name) C(a) = struct2cell(T); end M = cat(4,C{:}) M(isnan(M))=0 % replace NaN to 0
ave = mean(M,4) % mean of the 4th dimension
however,
how do i obtain the mean of a single location/variable from all these 240 files, eg: location{100,10,50} ?
thank you
Best Answer