comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Storing values in array after each iteration in for loop
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Storing values in array after each iteration in for loop [message #91266 is a reply to message #91265] Wed, 24 June 2015 20:41 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 6/24/15 4:44 PM, kcs4315@g.rit.edu wrote:
> Hi,
>
> I'm very new to IDL....
>
> Essentially what I want to do is after each iteration of a for loop,
> store the value it produces in an array. I originally tried making
> the array in the for loop but it was over written every time it went
> through an iteration, so only the last value was stored and
> everything else was 0. Is there an easy way to remedy this?

I imagine it would be something like:

x = fltarr(n)
for i = 0L, n - 1L do begin
x[i] = ; whatever processing you want to do here
endfor

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: cgScaleVector and diverging colorbar help
Next Topic: Identifying outliers in data

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 06:32:57 PDT 2025

Total time taken to generate the page: 0.24141 seconds