On Wed, Nov 17, 2010 at 10:41 AM, Eduardo D. da Costa <[email protected]> wrote:
> Dear Alexander,
>
> Thanks for your octcdf package that is allowing me to to use octave in my
> new job. Before I used mainly matlab.
> In the file example_netcdf.m that comes with your package there is an
> example how to read a netcdf file :
>
> %---------------------------------------%
> % %
> % read data from a netcdf file %
> % %
> %---------------------------------------%
>
> nc =3D netcdf('example.nc','r'); % open netcdf file
> example.nc in read-only
>
> n =3D nc('longitude'); % get the length of
> the dimension longitude
>
> temp =3D nc{'temp'}(:); % retrieve the netcdf
> variable temp
> temp_units =3D nc{'temp'}.units; % retrieve the
> attribute units of variable temp
> temp_valid_range =3D nc{'temp'}.valid_range; % retrieve the
> attribute valid_range of variable temp
>
> global_history =3D nc.history; % retrieve the global
> attribute history
>
>
>
> However if you wish to get (not the length of the dimension longitude) but
> the longitude values themselves, how do you proceed ?
try this:
LON = nc{'longitude'}(:);
(notice the curly brackets)
Cheers,
Alex
> I tried octave3:34> LON =3D nc('longitude')(:) and get LAT =3D 360
> What I expected was to obtain LAT =3D-90 -89 -88 ... 89 90
>
> Thanks in advance for your help. My boss is asking for the pictures and your
> help would be very much appreciated.
>
> Best regards
>
> Eduardo
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
> Spend less time writing and rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> Octave-dev mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/octave-dev
>
>
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev