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

Home » Public Forums » archive » Re: naming elements in an array
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: naming elements in an array [message #28947] Mon, 21 January 2002 14:26 Go to previous message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
M wrote:
>
> Hi all,
> I've just written a routine which returns a single column matrix array of 14
> elements - what I'd like to do is to assign individual names to each value,
> so they can be called in calculations later on.
>
> Does anyone know how I can do this? (Apologies if this is a 'trivial'
> problem - I'm currently trying to teach myself the world if IDL, with not
> too much success!)
>
> Thanks for your time,
>
> Manish

Shouldn't be too hard. What about this?

zero = 0
one = 1
two = 2
three = 3
..
thirteen = 13

Now you can reference your array with my_array(nine) to get the tenth
element.

Or what about :-

the_median = my_array(0)
the_sum = my_array(1)
tenth_percentile = my_array(2)
etc

Is that what you mean? Or do you just want to access the values via a
loop :-

For i = 0,13 Do Begin
value = my_array(i)
;do some gonculations on value
End

HTH,

Andrew

------------------------------------------------------------ ---------
Andrew D. Cool .->-.
Electromagnetics & Propagation Group `-<-'
Surveillance Systems Division Transmitted on
Defence Science & Technology Organisation 100% recycled
PO Box 1500, Salisbury electrons
South Australia 5108

Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ ---------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: problems producing a colobar
Next Topic: Re: Widget backgrounds

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

Current Time: Wed Oct 08 14:52:54 PDT 2025

Total time taken to generate the page: 0.00370 seconds