Problem to load netCDF files (having >2 dimensions) with Matlab ncread via OPENDAP
I have issues to load a variable from a netCDF file via OPENDAP with the Matlab function ncread. ncread is built in function in my here used Matlab version 2019a.
The issue is the following: When I try the load a variable with more than 2 dimensions, I only get back zeros. As an example, I post here the link to a data set from the World Ocean Atlas 2013, available on our GEOMAR THREDDS Server.
The Matlab command, which only outputs zeros, is:
- sal = ncread('https://dm-data.geomar.de/thredds/dodsC/erda/WOA13_V2/v1.x.x/data/salinity/netcdf/decav/0.25/woa13_decav_s00_04v2.nc','s_an',[1 1 1 1],[1440 720 102 1]);
However, when I try to load just a reduced cut-out data set, where only the first index of the 3rd dimension is read ("102" --> "1"), it works. So the adapted Matlab command from above, which provides a proper output, is:
- sal = ncread('https://dm-data.geomar.de/thredds/dodsC/erda/WOA13_V2/v1.x.x/data/salinity/netcdf/decav/0.25/woa13_decav_s00_04v2.nc','s_an',[1 1 1 1],[1440 720 1 1]);
Does anyone have an idea, why this is the case?