Prev: question about getting posterior probability using classregtree
Next: Constants in Objective Function for lsqcurvefit
From: Matthew on 25 Feb 2010 14:25 Hi, I am trying to use matlab to read data from a netcdf file, modify the data, and write it to a new netcdf file. Everything works fine, however when i try to write my matrix to a netcdf file the last 1,303 data points are ignored. The matrix (totalaerosol) I am trying to write to the file is a 4-D matrix with 42,240 data points, but only 40,937 of those data points actually get written to the netcdf file. The remaining data points that are not written to the file are replaced with ' _, _, _, _, _, _, _, ' A portion of my m-file is copied below: % Output data to a new netcdf file % Get the dimensions of data to be written to file [aerx, aery, aerz, aert] = size(totalaerosol); % Create netCDF files aerosoltotal = netcdf.create('Total_Aerosol_Concentration.ncf','NC_WRITE'); % Define the dimensions of the variables aerdimID1 = netcdf.defDim(aerosoltotal,'COL',aerx); aerdimID2 = netcdf.defDim(aerosoltotal,'ROW',aery); aerdimID3 = netcdf.defDim(aerosoltotal,'total_aer_dim3',aerz); aerdimID4 = netcdf.defDim(aerosoltotal,'TSTEP',aert); % Define a new variable in the file aervarID = netcdf.defVar(aerosoltotal,'total_ACONC','double',... [aerdimID1 aerdimID2 aerdimID3 aerdimID4]); % Assign unit attributes netcdf.putAtt(aerosoltotal,aervarID,'units','micrograms / m^3'); % Leave define mode and enter data mode to write data. netcdf.endDef(aerosoltotal); % Write data to variable netcdf.putVar(aerosoltotal,aervarID,totalaerosol); ---------------------- Anybody have any suggestions or thoughts on what might be wrong? Thanks in advance, Matt |