Navigation :
Top/netcdf
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- netcdf へ行く。
- 1 (2004-07-25 (日) 01:17:30)
- 2 (2005-02-02 (水) 19:32:20)
- 3 (2005-07-01 (金) 20:37:45)
- 4 (2006-06-08 (木) 20:02:36)
- 5 (2006-06-09 (金) 19:14:53)
- 6 (2006-07-18 (火) 19:27:43)
- 7 (2006-11-28 (火) 16:25:08)
- 8 (2006-12-05 (火) 12:05:09)
- 9 (2006-12-05 (火) 12:05:09)
- 10 (2006-12-05 (火) 12:05:09)
- 11 (2006-12-05 (火) 12:05:09)
- 12 (2007-12-11 (火) 18:09:34)
- 13 (2007-12-11 (火) 18:09:34)
- 14 (2008-03-24 (月) 13:27:00)
- 15 (2008-07-11 (金) 01:45:52)
- 16 (2008-12-03 (水) 14:55:02)
- 17 (2008-12-03 (水) 17:28:57)
- 18 (2012-03-11 (日) 02:19:08)
- 19 (2013-07-18 (木) 21:22:33)
netcdf -> mexncと改名 †
Linuxの場合 †
ダウンロード †
- mexcdf.tar.gz をダウンロード
インストール †
mexcdf.tar.gzを解凍し、mexncの下にあるmakefileをコンパイルする. matlab/bin/mexopt.shをコピ−し.
make -f makefile
とし,mexncを生成. 注意) 環境に合わせてmexopt.sh(サンプル)の編集が必要
startup.mに以下を記述する。
addpath /usr/local/matlab6/toolbox/netcdf/netcdf/ncutility addpath /usr/local/matlab6/toolbox/netcdf/netcdf/nctype addpath /usr/local/matlab6/toolbox/netcdf/netcdf addpath /usr/local/matlab6/toolbox/netcdf
matlabを起動し、mexnc/test/test_mexnxを実行するとテストプログラムが起動する。 ちゃんと起動したら、正しくインストールされたことになる(はず)。
Windowsの場合 †
ダウンロード †
- mexcdf.zip, mexnc-R14-win.zip, snctools.zip, netcdf_toolbox.zip をダウンロード
インストール †
mexnc-R14-win.zipを解凍し、mexnc.dllを$(matlab)/binおよび$(matlab)/bin/w32の下におく.
startup.mに以下を記述する。
addpath /usr/local/matlab7/toolbox/mexnc addpath /usr/local/matlab7/toolbox/netcdf_toolbox/netcdf/ncutility addpath /usr/local/matlab7/toolbox/netcdf_toolbox/netcdf/nctype addpath /usr/local/matlab7/toolbox/netcdf_toolbox/netcdf/source addpath /usr/local/matlab7/toolbox/snctools
matlabを起動し、mexnc/test/test_mexnxを実行するとテストプログラムが起動する。 ちゃんと起動したら、正しくインストールされたことになる(はず)。
使い方 †
netCDFデータを読む †
- 文法
- nc = netcdf('path', 'mode')
- nc -- The output "netcdf" object, or [] if error.
- path -- The path (filename) as a string.
- mode -- The string 'nowrite' or 'write'.
- 例
- nc = netcdf('foo.nc', 'nowrite')
ファイルを閉じる †
- 文法
- result = close(nc)
ファイルの情報を得る †
- 文法
- theDims = dim(nc)
- theVars = var(nc)
- theGAtts = att(nc)
- theRecdim = recdim(nc)
- 内容
- nc -- "netcdf" object.
- theDims -- List of "ncdim" dimension objects.
- theVars -- List of "ncvar" variable objects.
- theGAtts -- List of "ncatt" global attribute objects.
- theRecdim -- The "ncdim" record-dimension object.
- 例
- nc = netcdf('foo.nc', 'write')
- if isempty(nc), error(' ## Bad netcdf operation.'), end
- theDims = dim(nc) % List of "ncdim" dimension objects.
- theVars = var(nc) % List of "ncvar" variable objects.
- theGAtts = att(nc) % List of "ncatt" global attribute objects.
- theRecdim = recdim(nc) % The "ncdim" record-dimension object.
オブジェクトからデータを得る †
- 文法
- theVar = nc{'theVarname'}
- theVar = ncvar('theVarname', nc)
- 内容
- theVar -- The "ncvar" variable object.
- nc -- The parent "netcdf" object.
- theVarname -- The string-name of the variable.
- 例
- theVar = nc{'elevation'}