Converting 3D matrix to 2D matrix .

19 ビュー (過去 30 日間)
Reza E Rabby
Reza E Rabby 2018 年 4 月 11 日
回答済み: KSSV 2018 年 4 月 11 日
I have 3D(20*28*8) matrix . want to convert into 2D (20*28) matrix .Where last 8 means three hour interval one day precipitation data . I want to convert it into daily data(sum of three hour interval 8 data into 1 data ). I have used followed code .
cmorph_precip=ncread('267523.cmorph_precip.cmorph.3hr-025deg.20030702.nc','cmorph_precip')
nd=size(cmorph_precip,3)
sum_rain=zeros(20,28)
for i=1,nd
rain=cmorph_precip(:,:,i)
sum_rain=sum_rain+rain
end

採用された回答

KSSV
KSSV 2018 年 4 月 11 日
A = rand(20,28,8) ;
m = mean(A,3) ;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by