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

Home » Public Forums » archive » Baffled by out of range subscript error
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: Baffled by out of range subscript error [message #93503 is a reply to message #93501] Mon, 08 August 2016 10:18 Go to previous messageGo to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Monday, August 8, 2016 at 12:23:09 PM UTC-4, Med Bennett wrote:
> My 3D array is 177 by 127 by 28, but I get an error stating out of range subscript at [i,j,k] = [170,21,23], which are clearly not out of range,

It could be out of range if the right hand side is a vector. Can you give the help output for

hc_fraction[w] * weights

?


> weights = (1./d^2 * length)/total((1./d^2 * length))
> ===> if c gt 0 then hc_bm_id2[i,j,k] = hc_fraction[w] * weights
>
> endfor
> endfor
> endfor
> ==========================================================
>
> % Out of range subscript encountered: HC_BM_ID2.
> % Execution halted at: $MAIN$ 21 E:\Fulton\hc_model.pro
> IDL> print,i,j,k
> 170 21 23
> IDL> help,hc_bm_id2
> HC_BM_ID2 FLOAT = Array[177, 127, 28]
> IDL> help,hc_bm_id2[i,j,k]
> <Expression> FLOAT = 0.000000
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: open file (double click)
Next Topic: Odd behavior with NaNs

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

Current Time: Thu Oct 09 15:21:06 PDT 2025

Total time taken to generate the page: 1.28091 seconds