Hi Xia, If you need to change just that one element, then what Jaison suggests is exactly what you want to do, but here is a way to keep the name of the variable intact, using the SET VARIABLE/NAME= qualifier as follows. example: create a variable and save it in a netcdf file; then open that file and change one element. ! Define a variable and save it to a file. Note that if you're fixing missing values of a variable, you will want to look at the transformations, such as the @FAV transformation, so that if there were a number of missing values which are marked by a flag, say a=999 then you would do yes? set var/bad=999 a yes? let a_fix = a[x=@FAV:3] and this would fill all the missing data with the average of the two surrounding points. Ansley Xia Changshui wrote: Dear all, I have a simple question which puzzles me for a long time. In Ferret how can I change the value of an element of a variable? For instance using set data a.nc I get an array a(100) into Ferret. If I want let the 50th element of the array a(50)=(a(49)+a(51))/2.0, How can I achieve this? Thank you. Xia -- ~> ~> ~> ~> ~> ~> ~> ~> ~> ~> ~> Ansley Manke, NOAA/PMEL ansley.b.manke@xxxxxxxx 7600 Sand Point Way NE, Seattle WA Phone 206-526-6246, FAX 206-526-6744 |