how can I use mean for cell arrays within cell

조회 수: 4 (최근 30일)
Farshid Daryabor
Farshid Daryabor 2020년 2월 25일
댓글: Farshid Daryabor 2020년 2월 26일
Dear users,
I want to calculate the annual average of the attached file from the data in the cell array, regardless of the NaNs values.
Thanks in advance,

답변 (1개)

Bhaskar R
Bhaskar R 2020년 2월 25일
result = cellfun(@(x)mean(x, 'omitnan'), [T_mon{:}])
  댓글 수: 2
Farshid Daryabor
Farshid Daryabor 2020년 2월 25일
Bhaskar, thanks for your comment, but I want to keep the order of the temperature values ​​with respect to the depth decrease as in the original. Could you please leave me your idea. Thanks
Farshid Daryabor
Farshid Daryabor 2020년 2월 26일
The following comment is what I expected to be.
result = cellfun(@(x) nanmean(x,2), T_mon,'UniformOutput',false);
Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Verification, Validation, and Test에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by