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

Home » Public Forums » archive » Re: IDL calculating elements in arrays plus there offsets
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: IDL calculating elements in arrays plus there offsets [message #70041 is a reply to message #70040] Mon, 08 March 2010 04:31 Go to previous messageGo to previous message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
On Mar 8, 11:43 am, Will <theloneguitar...@hotmail.co.uk> wrote:
> Hi
>
> sorry I don't think the heading was very clear there.
>
> I have loaded a group of arrays (jpeg files) into a seperate float
> array, and again with another group of files I have done the same
> thing. I am now trying to have the two arrays perform a subtraction
> calculation with one another and what I want to do is have the arrays
> do this with each other until they have did the calculation with every
> element. i.e
>
> it does the first calculation, then offsets the elements by one to the
> right and does the next calculation then repeats this until it has
> done every element in the array.
>
> I was curious as to how to do this successflly I am currently trying
> to use a FOR loop after my Repeat loop failed. I have the maths I need
> here but I don't know how to access the subscripts of my array. I have
> inputted all the files into an array using the FLOAT command. the
> likes of FLTARR just keeps saying that I have more than 8 dimensions
> and hence it won't work.
>
> Any ideas guys?
>
> Thanks
>
> Will

Hi Will,

do you mean like this?:

arr1 = [3, 4, 2, 8]
arr2 = [1, 0, 4, 8]
diff = arr1 - arr2

print,diff
2 4 -2 0

'diff' will be a 4-element, one dimensional array in this case, but
can just as easily be multidimensional.
So long as the number of elements in both arrays are the same, simply
using the '-' operator will do.

Regards,
Chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: OT: Summer of Code 2010 is on!
Next Topic: Dynamic arrays in structs: re-allocation problem

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

Current Time: Mon Dec 01 14:58:15 PST 2025

Total time taken to generate the page: 0.64181 seconds