Re: How to do a "match merge"? [message #27583 is a reply to message #27578] |
Thu, 25 October 2001 15:24   |
Joe Means
Messages: 44 Registered: November 1996
|
Member |
|
|
<html><head></head><body>Thanks to JD, Pavel and Dick who responded. The simple approach below should work just fine.<br>
Joe Means<br>
<br>
JD Smith wrote:<br>
<blockquote type="cite" cite="mid:3BD86DD2.EA6A4E6@astro.cornell.edu"><pre wrap="">Joe Means wrote:<br></pre>
<blockquote type="cite"><pre wrap="">;I have a structure:<br>segment = {seg:0, piece:0, rotation:0.0, length:0.0}<br>segments = Replicate(segment, 2000)<br><br>;then I read data to fill array segments. For each segment there can<br>be 1 or more values of piece,<br>;so the data in segments can look like:<br>segment piece rotation<br>1 1 1.3<br>1 2 5.7<br>2 1 4.4<br>2 2 3.4<br>2 3 5.5<br>......<br><br>;then I calculate length for each segment and put those values in a<br>vector array whose index is equal to segment-1, so each length can be<br>easily matched to each segment. My question is can I effeciently<br>match the length values into the structure for each piece without<br>looping? Statistical programming languages like SAS have match-merge<br>capabilities so this kind of thing is simple, but I am not aware of<br>similar capabilities in IDL.<br><br></pre></blockquote>
<pre wrap=""><!----><br>Will <br><br>IDL> segments.length=seg_len_vec[segments.segment-1]<br><br>do what you want?<br><br>JD<br></pre>
</blockquote>
<br>
<pre class="moz-signature">--
Joseph E. Means
Assistant Professor, <a class="moz-txt-link-abbreviated" href="mailto:joe.means@orst.edu">joe.means@orst.edu</a>
Department of Forest Science
Oregon State University
Corvallis, OR 97331-5752
541-750-7351</pre>
<br>
</body></html>
|
|
|