Compute the mean row cell elements in a cell array.
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
I have a 3x11 cell array. Each cell contains a 128 x 1000 element.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828035/image.png)
I would like to compute the mean of the all the rows but leaving the columns alone, so that the results will be a 1 x 11 cell array with each element = 128x1000. Please help. Thanks
Eric
댓글 수: 0
채택된 답변
Stephen23
2021년 12월 9일
Where C is your cell array:
fun = @(varargin)mean(cat(3,varargin{:}),3);
D = cellfun(fun,C(1,:),C(2,:),C(3,:),'uni',0)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!