フィルターのクリア

Create a list of means from a 3D matrix

2 ビュー (過去 30 日間)
Brian Bartlett
Brian Bartlett 2018 年 5 月 15 日
編集済み: the cyclist 2018 年 5 月 15 日
Hi! I am working with a 3D matrix of 360x200x60 of temperatures in dimensions of latitude x longitude x time. I want to find a way to take averaged temperature data for each of the 60 time steps, so I believe I need a list of 60 mean temperatures so that I can plot this over time. I can find means for each individual time step using the code:
nanmean(nanmean(MATRIXNAME(1:360,2:200,1)))
and changing the 1 to 2, 3, etc for each time step. Can I tell MatLab to automate this into a single list for all 60 time steps? Thank you!

回答 (1 件)

the cyclist
the cyclist 2018 年 5 月 15 日
編集済み: the cyclist 2018 年 5 月 15 日
M = rand(360,220,60);
timeStepMean = nanmean(nanmean(M(:,2:end,:),1),2);
You might then want to use the reshape command to make the resulting 1x1x60 vector into either a row or column vector.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by