how to select the desired range of each dimension from the 3d array?

조회 수: 2 (최근 30일)
BN
BN 2019년 10월 8일
댓글: BN 2019년 10월 8일
Hello all,
I have 3d double array (precipitation=1439*719*1512) that is:
latitude=1439
longitude=719
time=1512
now I want to select a range from each dimension and build a new array named new_precipitation like this:
latitude range = 1400 to 1439
longitude range = 500-519
time= 700-900
in fact, new_precipitation is 3d array with the size of 39*19*200
how to do this? please help me with this issue.
Best Regards

채택된 답변

Adam
Adam 2019년 10월 8일
편집: Adam 2019년 10월 8일
new_precipitation = precipitation( 1400:1439, 500:519, 700:900 )
would create what you ask for though it will be 1 bigger in each dimension than you say it should be - 40x20x201.
If your final size is fixed you need to reduce each range by 1 at either end.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by