- extracting a 2D array (290x480) from your 3D array (290x480x90 ) out = in(:,:,k); where k is your frequency index
- use either interp2 or griddata for 2D interpolation
- griddata : Interpolate 2-D or 3-D scattered data
- interp2 : Interpolation for 2-D gridded data in meshgrid format
Accessing (interpolating?) data in 3D array
1 view (last 30 days)
Show older comments
I have been using Matlab for many years but this is my first time working with a 3D array. My data is 290x480x90 in the format latitude x longitude x frequency. So it contains sound pressure data for a range of locations at different frequencies. I am wondering if I could then create a separate array e.g. 10x2x1 of lat/lon locations at a particular freq of interest that lie within the main array, and pull those data points out? Those specific locations of interest therefore don't necessarily occur as points of the 3D array but they are within it... hopefully that makes sense.
5 Comments
Mathieu NOE
on 26 Nov 2021
yes , squeeze may be needed , even thought on my matlab release (R2020b) it seems not to be required (?)
i did this simple test and the output array dimension is like we wanted
>> a = randn(30,10,3);
>> b = a(:,:,1);
>> whos
Name Size Bytes Class Attributes
a 30x10x3 7200 double
b 30x10 2400 double
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Orange in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!