# Mean computaion in matlab

조회 수: 3(최근 30일)
Berhanu Geremew 2021년 7월 22일
답변: Berhanu Geremew 2021년 7월 23일
How to comput mean of 3D mat file having lon, lat ,value !

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

### 채택된 답변

If your data is in a matrix of dimensions [samples x 3], e.g.
data=[lon1 lat1 value1;
lon2 lat2 value2;
lon3 lat3 value3;
lon4 lat4 value4;
...
]
then you simply need to do
mean(data) and that will calculate the mean of each column.

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

### 추가 답변(2개)

James Tursa 2021년 7월 22일
You can specify the dimension to use with the mean( ) function. E.g., maybe this is the computation you want:
ave = mean(data,3); % mean of 3rd dimension
##### 댓글 수: 0표시숨기기 이전 댓글 수: -1

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

Berhanu Geremew 2021년 7월 23일
Dear Jemes
Thank you so much Jemes
I need the spatial mean for earch grid value Lat, Lon, Mean(Value) .
Cheers
Berhanu

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

### Community Treasure Hunt

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

Start Hunting!

Translated by