MATLAB Answers


problems reading large netcdf file; returns zeros

Asked by Bodil
on 22 Nov 2012

My netcdf file contains temperatures in 6 hours time bins between 1991 and 2010. From nc_dump or ncdisp, I get the information that the temperature comes in the dimension 96x48x63x30660, i.e. longitude, latitude, pressure level and time. However, after time step 1071, the matrix seems to be filled with up zeros. Even the time vector gives me zeros after 1071 elements. Up until then, the temperature data looks fine. People using IDL get the whole file, so it doesn't seem to be an issue with the netcdf-file. I don't get an error message.

Here is my routine:


filename = '';


for i=1:(30660/4);

one_day_of_data=ncread(filename,'temp',[1 1 1 ind(i)],[96 48 63 4],[1 1 1 1]);




  1 Comment

Is the file available for public download? I cant explain why this might happen (MATLAB uses libnetcdf under the hood).


No products are associated with this question.

0 Answers

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!