/[MITgcm]/MITgcm_contrib/gael/profilesMatlabProcessing/profiles_misc/ncvars.m
ViewVC logotype

Contents of /MITgcm_contrib/gael/profilesMatlabProcessing/profiles_misc/ncvars.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Nov 5 21:41:02 2010 UTC (14 years, 8 months ago) by gforget
Branch: MAIN
- make this work both with the legacy mexnc stuff (as before)
  and with the modern matlab native netcdf implementation.

1 function [vars]=ncvars(ncid);
2 %input: ncid is a netcdf file id
3 %output: vars is the list of its variables name (in cell)
4
5 [numdims, numvars, numglobalatts, unlimdimID] = netcdf.inq(ncid);
6 for ii=1:numvars;
7 aa=netcdf.inqVar(ncid,ii-1);
8 if ii==1; vars={aa}; else; vars=[vars aa]; end;
9 end;

  ViewVC Help
Powered by ViewVC 1.1.22