**To**:**"Balaguru, Karthik" <karthiknaidu@xxxxxxxxxxxx>****Subject**:**Re: [ferret_users] Looping over arrays****From**:**Ansley Manke <ansley.b.manke@xxxxxxxx>**- Date: Wed, 14 Oct 2009 15:47:08 -0700
- Cc: oar.pmel.ferret_users@xxxxxxxx
- In-reply-to: <792074894.1916881255542934273.JavaMail.root@neo-mail-3>
- References: <792074894.1916881255542934273.JavaMail.root@neo-mail-3>
- Sender: owner-ferret_users@xxxxxxxx
- User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Hi Karthik, I think I understand what you want to do. You have three 1-dimensional variables, which are x, y, and t values that are locations in the the grid of an XYT variable sst. Is that correct? Are the values in the time array times, or index values? That is, do they have units of days, or hours, or other time-units since the start? Or are they index values 1, 2, ... NT? Assuming that the data in l(i) are in the same units of time as the time axis of sst, then you can use the SAMPLEXYT function to get the values of variable sst at each of your scattered xyt locations. Say the 1-dimensional variables are called xloc, yloc, tloc. When this is evaluated, it will be a 1-dimensional variable, sst at each of the scattered locations. Then to subtract the value of sst at ( xloc(i+1), yloc(i+1), tloc(i+1) ) minus sst at ( xloc(i), yloc(i), tloc(i) ), the _expression_ is
Ansley Balaguru, Karthik wrote: Hi all, I have a problem with arrays in ferret. I have an array with three colums [x(i) y(i) l(i)], which are lat, lon and time respectively. The problem is they are not continuous, i.e; for each i, x,y and l are random. I have the corresponding sst data. Now for i=1:n I want to read in the array data and then calculate the sst change, like sst_change(i) = sst(x(i),y(i),l(i) + 1) - sst(x(i),y(i),l(i) + 1) It'll be great if somebody can help me out with this. Thanks! Truly, Karthik. |

**References**:**[ferret_users] Looping over arrays***From:*Balaguru, Karthik

- Previous by thread:
**[ferret_users] Looping over arrays** - Next by thread:
**Re: [ferret_users] Looping over arrays**

Contact Us

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement