MATLAB Answers

Monica
0

Problem with change a files whitin netcdf

Asked by Monica
on 22 Oct 2013
Latest activity Edited by Ashish Uthama on 31 Oct 2013
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 ...

  0 Comments

Sign in to comment.

Tags

2 Answers

Answer by Ashish Uthama on 22 Oct 2013
 Accepted Answer

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.

  0 Comments

Sign in to comment.


Answer by Monica
on 23 Oct 2013
Edited by Ashish Uthama on 31 Oct 2013

[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

  0 Comments

Sign in to comment.