필터 지우기
필터 지우기

Calculating a mean matrix of a cell array

조회 수: 2 (최근 30일)
CSCh
CSCh 2023년 7월 10일
댓글: CSCh 2023년 7월 10일
Hi,
I have a A=78757x1 cell, consiting of {125×15 double} matrices.
How can I calculate the mean of all (78757) matrixes, ( "element-by-element" for each matrix) so that I have a mean Matrix of 125*15 at the end. A contains also sometimes NaN entries.
Thanks,
Chris

채택된 답변

Stephen23
Stephen23 2023년 7월 10일
편집: Stephen23 2023년 7월 10일
M = mean(cat(3,A{:}),3,'omitnan')

추가 답변 (1개)

Paul
Paul 2023년 7월 10일
Try
mean(cat(3,A{:}),3,'omitnan')
The omitnan flag will ignor the nan entries in the computation of the mean.
  댓글 수: 1
CSCh
CSCh 2023년 7월 10일
Thank you so much, Paul & Stephen.

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

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by