Incremental median across pages of a 3D array
조회 수: 2(최근 30일)
I am trying to compute the inter-page median,
of a 3D array A except that A is too large to be held in memory in its entirety and its pages A(:,:,k) occupy separate files on disk (EDIT: and I do not have the means to read in strict subchunks of a page). Is there an algorithm, and ideally also a Matlab implementation somewhere, that will compute B incrementally by looping over successive pages A(:,:,k), or chunks of pages?
Gaurav Garg 2021년 1월 28일
You can compute the median of each column by converting the column into tall column and then calculating its median. You can repeat the step for each column (in your case).
answer = gather(m);
Or, you can also convert the array into distributed array and then compute median (though the former solution might be more useful).
D = distributed(A);
e = median(D);