From: <aba...@us...> - 2010-11-17 09:12:28
|
Revision: 7926 http://octave.svn.sourceforge.net/octave/?rev=7926&view=rev Author: abarth93 Date: 2010-11-17 09:12:22 +0000 (Wed, 17 Nov 2010) Log Message: ----------- remove short-circuit operator Modified Paths: -------------- trunk/octave-forge/main/octcdf/DESCRIPTION trunk/octave-forge/main/octcdf/inst/example_netcdf.m trunk/octave-forge/main/octcdf/inst/ncdump.m Modified: trunk/octave-forge/main/octcdf/DESCRIPTION =================================================================== --- trunk/octave-forge/main/octcdf/DESCRIPTION 2010-11-17 08:34:13 UTC (rev 7925) +++ trunk/octave-forge/main/octcdf/DESCRIPTION 2010-11-17 09:12:22 UTC (rev 7926) @@ -1,6 +1,6 @@ Name: octcdf -Version: 1.1.0 -Date: 2010-04-27 +Version: 1.1.1 +Date: 2010-11-17 Author: Alexander Barth <bar...@gm...> Maintainer: Alexander Barth <bar...@gm...> Title: octcdf Modified: trunk/octave-forge/main/octcdf/inst/example_netcdf.m =================================================================== --- trunk/octave-forge/main/octcdf/inst/example_netcdf.m 2010-11-17 08:34:13 UTC (rev 7925) +++ trunk/octave-forge/main/octcdf/inst/example_netcdf.m 2010-11-17 09:12:22 UTC (rev 7926) @@ -44,27 +44,29 @@ nc{'longitude'} = ncdouble('longitude'); % create a variable longitude of type double with % 360 elements (dimension longitude). nc{'longitude'}(:) = longitude; % store the octave variable longitude in the netcdf file -nc{'longitude'}.units = 'degree West'; % define a string attribute of the variable longitude +nc{'longitude'}.units = 'degrees_east'; % define a string attribute of the variable longitude % coordinate variable latitude nc{'latitude'} = ncdouble('latitude');; % create a variable latitude of type double with % 181 elements (dimension latitude). nc{'latitude'}(:) = latitude; % store the octave variable latitude in the netcdf file -nc{'latitude'}.units = 'degree North'; % define a string attribute of the variable latitude +nc{'latitude'}.units = 'degrees_north'; % define a string attribute of the variable latitude % variable temp -nc{'temp'} = ncdouble('longitude','latitude'); % create a variable temp of type double of the size 360x181 +nc{'temp'} = ncdouble('latitude','longitude'); % create a variable temp of type double of the size 360x181 % (dimension longitude and latitude). nc{'temp'}(:) = temp; % store the octave variable temp in the netcdf file +nc{'temp'}.long_name = 'Temperature'; nc{'temp'}.units = 'degree Celsius'; % define a string attribute of the variable nc{'temp'}.valid_range = [-10 40]; % define a vector of doubles attribute of the variable + % define a global string attribute nc.history = 'netcdf file created by example_netcdf.m in octave'; - % define a global string attribute +nc.title = 'sample file'; -ncclose(nc) % close netcdf file and all changes are written to disk +close(nc) % close netcdf file and all changes are written to disk disp(['example.nc file created. You might now inspect this file with the shell command "ncdump -h example.nc"']); Modified: trunk/octave-forge/main/octcdf/inst/ncdump.m =================================================================== --- trunk/octave-forge/main/octcdf/inst/ncdump.m 2010-11-17 08:34:13 UTC (rev 7925) +++ trunk/octave-forge/main/octcdf/inst/ncdump.m 2010-11-17 09:12:22 UTC (rev 7926) @@ -105,7 +105,7 @@ fprintf(fid,['nc.%s = nc%s(%s);\n'],ncname(na{j}),datatype,att2str(na{j})); end -fprintf(fid,'ncclose(nc)\n'); +fprintf(fid,'close(nc)\n'); if (fid ~= 1) fclose(fid); @@ -131,7 +131,7 @@ n = length(att); val = att(:); - if (n == 1 | strcmp(datatype,'char')) + if (n == 1 || strcmp(datatype,'char')) s = sprintf(f,val); else s = '['; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |