Re: About 2D array index [message #62008] |
Fri, 15 August 2008 04:19 |
Juggernaut
Messages: 83 Registered: June 2008
|
Member |
|
|
On Aug 14, 10:26 pm, xiao <littledd...@gmail.com> wrote:
> On Aug 14, 9:13 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> xiao writes:
>>> Can any one tell me how the index arranged? For example, An array
>>> like this :
>
>>> 10 13 14
>>> 59 13 20
>>> 45 9 12
>
>>> Is the index like this?
>
>>> 0 1 2
>>> 3 4 5
>>> 6 7 8
>
>>> Thank you~
>>> Actually , I tried to print the index and the result is like above but
>>> when I tried to large 2D array, it seems it is not right..........
>
>> It's right. :-)
>
>> Cheers,
>
>> David
>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Thank you David~ :)
For a large array the type of array you are using may not have enough
numbers to reach the end.
If you use indgen(258, /byte) then the last two numbers in the array
will be 0 and 1 since it will cycle
back on itself seeing as how the limit of a number of type byte is 255.
|
|
|
Re: About 2D array index [message #62013 is a reply to message #62008] |
Thu, 14 August 2008 19:26  |
xiao zhang
Messages: 81 Registered: June 2008
|
Member |
|
|
On Aug 14, 9:13 pm, David Fanning <n...@dfanning.com> wrote:
> xiao writes:
>> Can any one tell me how the index arranged? For example, An array
>> like this :
>
>> 10 13 14
>> 59 13 20
>> 45 9 12
>
>> Is the index like this?
>
>> 0 1 2
>> 3 4 5
>> 6 7 8
>
>> Thank you~
>> Actually , I tried to print the index and the result is like above but
>> when I tried to large 2D array, it seems it is not right..........
>
> It's right. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Thank you David~ :)
|
|
|
Re: About 2D array index [message #62015 is a reply to message #62013] |
Thu, 14 August 2008 19:13  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
xiao writes:
> Can any one tell me how the index arranged? For example, An array
> like this :
>
> 10 13 14
> 59 13 20
> 45 9 12
>
> Is the index like this?
>
> 0 1 2
> 3 4 5
> 6 7 8
>
> Thank you~
> Actually , I tried to print the index and the result is like above but
> when I tried to large 2D array, it seems it is not right..........
It's right. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|