MATLAB Answers


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

Asked by Behzad Navidi on 8 Oct 2019
Latest activity Commented on by Behzad Navidi on 8 Oct 2019
Hello all,
I have 3d double array (precipitation=1439*719*1512) that is:
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


Sign in to comment.

1 Answer

Answer by Adam
on 8 Oct 2019
Edited by Adam
on 8 Oct 2019
 Accepted Answer

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.

  1 Comment

Sign in to comment.