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

Home » Public Forums » archive » Re: Help assigning values to ranges of 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: Help assigning values to ranges of elements in an array??? [message #5200 is a reply to message #5196] Wed, 11 October 1995 00:00 Go to previous message
rmmoss is currently offline  rmmoss
Messages: 12
Registered: August 1995
Junior Member
Use array indexing. For example

a = intarr(200)
a(0:100)=3

Will set the values for a(0) through a(100) equal to 3. You can use an
asterisk to specify an open range, for example

a( 100:*)=5

will set all the values of a(100) to a(199) to 5.

----------
Robert Moss, Ph.D.
Texaco Inc.
mossrm@texaco.com

This is not necessarily the opinion of Texaco Inc.
----------

In article <45ff2r$n3f@mirv.unsw.edu.au>, jgm@nntp.unsw.EDU.AU (Julian Marshall) writes:
|> Hi.
|> I was hoping someone could help me by suggesting a way by which
|> I can assign values to a range of elements in an array. To be
|> more exact, I want to make elements 0 to 100 (for eg.) of a
|> 200 element array equal to a value or equal to values in a 100
|> element array.
|> Of course I can use for loops but I feel this is inefficient and
|> a bit annoying when handling 256*256*256 bytarrs.
|> IDL allows one to use an array operation to specify a range of
|> values in an array (ie. A=B>10) but is it possible to use an
|> array operation to specify a range of elements.
|> Thanx
|>
|> julian
|> jgm@newt.phys.unsw.edu.au
|> .
|>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: limit of number vortices
Next Topic: HELP: IDL Function/Variable Problem

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

Current Time: Sat Apr 04 10:43:27 PDT 2026

Total time taken to generate the page: 0.72205 seconds