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

Home » Public Forums » archive » Instances of structure array with varying no. of elements
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: Instances of structure array with varying no. of elements [message #87370 is a reply to message #87364] Tue, 28 January 2014 08:53 Go to previous message
midhunjoyp is currently offline  midhunjoyp
Messages: 5
Registered: January 2014
Junior Member
On Tuesday, January 28, 2014 10:47:40 AM UTC-5, midhu...@gmail.com wrote:
> Hi all,
>
>
>
> I have an array of structure arrays of the following simplified form :
>
>
>
> results = REPLICATE({domain:REPLICATE({frame :fltarr(1), particles : fltarr(5,6000)}, 10)} , 500)
>
>
>
> ie, 'domain' is initialized as a struct array with 10 elements(instances),
>
> 'results' is initialized as an array of 'domain' arrays with 500 instances
>
>
>
> However during calculations, I would like to change the number of instances of 'domain' array in each instance of the 'results' array
>
>
>
> eg: results[0] should contain only 5 instances of 'domain' array
>
> results[1] should contain 7 instances of 'domain' array etc...
>
>
>
> I tried doing the following for it :
>
> results[0].domain = results[0].domain[0:4]
>
>
>
> But, with:
>
> print, n_elements(results[0].domain) : Returns value 10, which indicates that the size remains unchanged.
>
>
>
> Is there any method for doing this operation ?
>
>
>
>
>
> Best,
>
> Midhun

Hi Matthew & David,

I had completely forgotten the concept of lists.
Thanks a lot for the help.

Best,
Midhun
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Deleting specific instances of the structure
Next Topic: skip the corrupted hdf file and continue the for lood for uncorrupted hdfs

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

Current Time: Sat Oct 11 06:34:38 PDT 2025

Total time taken to generate the page: 1.51980 seconds