error using start and count vectors
Show older comments
first I've opened a netcdf file. there are 8640 longitude points and 4320 latitude points. it is a world map. I'm trying to map a specific region. I created start and count vectors, then tried to extract the bio data corresponding to those lats and lons. However, I get an error, and can't figure out why.
% make the start and count vectors
start = [1440 1248 1]; % longitude -120.0208, latitude 38.0208
count = [7321 1320 1]; % longitude 125.0208, latitude 35.0208
fld = ncread(url,'bio',start,count);
This is the error I get:
Error using matlab.internal.imagesci.netcdflib
The NetCDF library encountered an error during execution of
'getVarsFloat' function - 'Index exceeds dimension bound
(NC_EINVALCOORDS)'.
Error in netcdf.getVar (line 182)
data =
matlab.internal.imagesci.netcdflib(funcstr,ncid,varid,varargin{:});
Error in internal.matlab.imagesci.nc/read (line 637)
data = netcdf.getVar(gid, varid, ...
Error in ncread (line 66)
vardata = ncObj.read(varName, varargin{:});
1 Comment
BN
on 7 Nov 2022
Accepted Answer
More Answers (0)
Categories
Find more on NetCDF 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!