[Thread Prev][Thread Next][Index]

RE: [ferret_users] Define, change/add/remove element in an array.



Hello NIcolas

you can replace array elements if you can afford to rename your variable


set region/i=1:4 !! this is to limit abstract axis length to number of elements in the array
let var={1,3,5,7}
let new=if i[g=var] eq 3 then 0 else var !!! will replace third element to 0


Ofcourse , the whole point of your question may be that  you dont want to rename your variable. Then its difficult to do it ferret i guess. 


Rahul 



Date: Wed, 20 Aug 2014 13:24:20 +0800
Subject: [ferret_users] Define, change/add/remove element in an array.
From: nicolas.freychet@xxxxxxxxx
To: ferret_users@xxxxxxxx

Hi everyone,

Is there a simple comand to change/add elements inside an array.

For instance, I defined a single row array with :

         let listTemp = {`temp1`,`temp2`,`temp3`,`temp4`}

But then, I'd like to add new values `temp5`, `temp6`.... or change `temp1` to a new value.
I tried something like : "listTemp[i=1] = `temp5`" but it doesn't work.

If anyone knows how to do it....

Thanks,
Nicolas

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement