Mean of multidimensional array

조회 수: 3 (최근 30일)
Louise Wilson
Louise Wilson 2021년 12월 10일
댓글: Louise Wilson 2021년 12월 10일
I have a multidimensional array: 1000x72x4.
I would like to know the mean of all four sheets and so provide a single 1000x72 matrix.
mdar(:,:)=randi(1000,72,1000);
mdar(:,:,2)=randi(1000,72,1000);
mdar(:,:,3)=randi(1000,72,1000);
mdar(:,:,4)=randi(1000,72,1000);
mdar_mean=mean(mdar,[1 3]); %gives a 1000*1 array

채택된 답변

James Tursa
James Tursa 2021년 12월 10일
Doesn't mean(mdar,3) do what you want?
  댓글 수: 1
Louise Wilson
Louise Wilson 2021년 12월 10일
It does! Somehow I overlooked that. Thank you!!!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by