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

Home » Public Forums » archive » Index should be out of range, right?
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
Index should be out of range, right? [message #64519] Wed, 31 December 2008 11:42
T.H. is currently offline  T.H.
Messages: 13
Registered: December 2008
Junior Member
2008 is ending in confusion for me. Here is an example of why:

IDL> x=intarr(10,10)
IDL> y=indgen(15)
IDL> x[y,y]=1
IDL> print, x
1 0 0 0 0 0 0 0
0 0
0 1 0 0 0 0 0 0
0 0
0 0 1 0 0 0 0 0
0 0
0 0 0 1 0 0 0 0
0 0
0 0 0 0 1 0 0 0
0 0
0 0 0 0 0 1 0 0
0 0
0 0 0 0 0 0 1 0
0 0
0 0 0 0 0 0 0 1
0 0
0 0 0 0 0 0 0 0
1 0
0 0 0 0 0 0 0 0
0 1


This is confusing because some values of y are greater than the
dimensions of the array that they are being used to access and in
fact

IDL> x[y[10],y[10]]=1
% Attempt to subscript X with <INT ( 10)> is out of range.
% Execution halted at: $MAIN$

this fails. Why do I not get an "out of range error" in the first
case?

Thanks for your help.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Displaying images with logscale - followup
Next Topic: Re: Index should be out of range, right?

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

Current Time: Wed Oct 08 17:34:50 PDT 2025

Total time taken to generate the page: 0.00430 seconds