I have downloaded the sea surface temperature data from the Ocean Color website, the file is in NetCDF format and contains no of geophysical_data variables like sst, qual_sst, flag_sst, bias_sst, etc. I used the following MATLAB code for file read and it is giving me an error:



Error using internal.matlab.imagesci.nc/getGroupAndVarid (line 2075)
Could not find variable or group 'sst' in file.

Error in internal.matlab.imagesci.nc/read (line 593)
        [gid, varid] = getGroupAndVarid(this, location);

Error in ncread (line 58)
vardata = ncObj.read(varName, varargin{:});

Can someone tell me what is the cause of the error?

  • $\begingroup$ There is NetCDF-3 and NetCDF-4. What format is your data in and what format is your reading routine for? $\endgroup$
    – gerrit
    Jul 27, 2015 at 10:54
  • $\begingroup$ What is the main difference b/w these two ? because i don't know in which format my file is, how can i find that ? i checked the file property and its just show me .NC file type. $\endgroup$
    – Ahsan
    Jul 27, 2015 at 17:04
  • $\begingroup$ Several questions: Why that website for sea surface temperature? (Why not hycom.org?) What website? (It's always good to say exactly where.) What file did you download? Did you use ncdump to examine the contents of that file? Why did you use FTP when you could be using openDAP? $\endgroup$ Jul 28, 2015 at 13:55

1 Answer 1


These days I use: ncgeodataset. The routine allows for the extraction of a subset of data without having to load the entire file or even an array into Matlab. It is great for large datasets.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.