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

Home » Public Forums » archive » IDL Beginner exercise help
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 Beginner exercise help [message #93749 is a reply to message #93747] Wed, 12 October 2016 00:35 Go to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
Or

IDL> indgen(4,3, start=10)
10 11 12 13
14 15 16 17
18 19 20 21

which strictly speaking does not answer the specific question by not using [10:21], but has the same answer :)

PS: since OP is a beginner, I might point out that it is in general not a good idea to work with INTARR/INDGEN since the 16-bit integers these create, quickly will bite you with overflow problems. LONARR/LINDGEN (32-bit integers) should be a better default choice unless you are 100% certain that your data and the operations applied on them will fit in the interval [-32768,32767].

On Wednesday, 12 October 2016 03:13:01 UTC+2, wlandsman wrote:
> One way is
> IDL> a = reform( [10:21], 4,3)
>
> where REFORM reshapes your 12 element vector into a 4 x 3 array.
>
> On Tuesday, October 11, 2016 at 8:00:33 PM UTC-4, Cheryl wrote:
>
>>
>> Can I ask you one more question:)?
>>
>> How to create a 4 by 3 integer array that counts from 10 to 21?
>> C= INTARR(4,3) ; this is an integer array of two dimensions
>> but how do I write it with [10:21]?
>>
>> Thank you
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ncdf_varput for NetCDF coordinate axes
Next Topic: How to supress dialog popup when netcdf file is corrupt?

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

Current Time: Wed Oct 08 19:31:14 PDT 2025

Total time taken to generate the page: 0.00218 seconds