- 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 次查看(过去 30 天)
显示 更早的评论
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 个评论
Mathieu NOE
2021-11-26
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
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Orange 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!