필터 지우기
필터 지우기

Mean/average of a variable

조회 수: 4 (최근 30일)
Auryn_
Auryn_ 2019년 1월 25일
편집: Adam 2019년 1월 25일
Hello,
I have a variable P(a,b,c) where a=2, b=1:150,c=1:100.
Now, for each value of c, I want to calculate the mean of P:
M=mean(P(a,1:150,:))
where at the end I should have an array M(1,100).
Using what I showed above it does not work.
Coudl anyone help me?
Thanks in advance!

채택된 답변

Matt J
Matt J 2019년 1월 25일
편집: Matt J 2019년 1월 25일
M=mean(P(a,1:150,:),2)

추가 답변 (1개)

Adam
Adam 2019년 1월 25일
편집: Adam 2019년 1월 25일
M = mean( squeeze( P(a,:,:) )
should give what you want

카테고리

Help CenterFile Exchange에서 Semiconductors and Converters에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by