Problem with change a files whitin netcdf

1 回表示 (過去 30 日間)
Monica
Monica 2013 年 10 月 22 日
編集済み: Ashish Uthama 2013 年 10 月 31 日
I have a problem I do not know how to change the name of a variable within a file *.nc. Through ncwrite I can change the data in a specific variable within a netcdf file ... but change the name of the variable is not .. if someone could help me ...

採用された回答

Ashish Uthama
Ashish Uthama 2013 年 10 月 22 日
Try the netcdf.renamevar function. The doc page in the link has an example to get you started, post back if you run into any trouble.

その他の回答 (1 件)

Monica
Monica 2013 年 10 月 23 日
編集済み: Ashish Uthama 2013 年 10 月 31 日
[Edit: add code markup]
Thank you! ... I leave here my solution
My case:
ncdisp('vel_viento.nc')
ncid = netcdf.open('vel_viento.nc','WRITE')
varid = netcdf.inqVarID(ncid,'Vwind');
netcdf.renameVar(ncid,varid,'svstr');
netcdf.close(ncid);
Thanks for the help!
Best Regards

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by