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

Home » Public Forums » archive » Icrease a elements in a array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Icrease a elements in a array [message #91798] Fri, 28 August 2015 15:15 Go to next message
joyrles1996 is currently offline  joyrles1996
Messages: 27
Registered: August 2015
Junior Member
I have a array with 8 elements. I need to maintain the first and the last element, can't change and to change the others six. How do i do?

thanks for listening.
Re: Icrease a elements in a array [message #91801 is a reply to message #91798] Sat, 29 August 2015 09:27 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 8/28/15 4:15 pm, Joyrles Fernandes wrote:
> I have a array with 8 elements. I need to maintain the first and the
> last element, can't change and to change the others six. How do i
> do?
>
> thanks for listening.
>

Change only elements 1 to 6 then, i.e., if

x = findgen(8)

then do things like:

x[1] = 1.5
x[1:6] = findgen(6) * 3.0
etc.

where you don't access x[0] and x[7]. Do you mean something else?

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: help with WHERE( ) function
Next Topic: Mosaicking a folder of TIFF files that includes 1-D horizontal strips

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

Current Time: Wed Oct 08 11:33:55 PDT 2025

Total time taken to generate the page: 0.00397 seconds