How to edit a particular variable in a netcdf file?

48 ビュー (過去 30 日間)
Angshuman
Angshuman 2012 年 1 月 15 日
編集済み: John Kelly 2015 年 2 月 26 日
Hi, I am trying to modify a specific variable in a netcdf file. In my file a 4D-variable named MSUL_V(lat,lon,level,time) is there, i want to change the values of this variable at every lat and lon. I am not familiar with editing variables in netcdf package MATLAB.
Please help me about this. I do appreciate if everyone could help me about this. Thanks Angshuman

採用された回答

Ashish Uthama
Ashish Uthama 2012 年 1 月 16 日
編集済み: John Kelly 2015 年 2 月 26 日
You could use the ncwrite function to overwrite the variable.
  2 件のコメント
Angshuman
Angshuman 2012 年 1 月 18 日
ya, thank you
But my MATLAB does not support ncwrite...the netcdf package does not have that. Is there any other way....
Ashish Uthama
Ashish Uthama 2012 年 1 月 18 日
Yes, but it will need a bit more work. Have a look at this example: http://www.mathworks.com/help/techdoc/ref/netcdf.putvar.html (It creates a new file and write a new variable). You will have to code up something similar, i.e open a file in write mode, get the variable ID of your variable and then use putvar to overwrite it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by