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

Home » Public Forums » archive » Re: Want to get Array(48) instead of Array(1,48)
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: Want to get Array(48) instead of Array(1,48) [message #29983 is a reply to message #29872] Tue, 02 April 2002 08:24 Go to previous messageGo to previous message
chi-kuei is currently offline  chi-kuei
Messages: 5
Registered: March 2002
Junior Member
Thansk,
This one works well for me.

Chi-Kuei

"Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message
news:a7on9c$nj3$1@newsreader.mailgate.org...
> "chi-kuei" <twcollie@hotmail.com> wrote in message
> news:a7om25$8jn$1@news01.cit.cornell.edu...
>
>> ...I notice they are different because when I use curvefit, the
>> Array[1,48] will give me error message, the Array[48] will not.
>>
>> I can make the Array[1,48] become Array[48] without changing the
>> value by doing this:
>>
>> IDL> test_array = test_array(*)
>>
>> This means extra steps. Am I doing this in the longer way? Is there
>> any shortcut of doing this.
>
> No, there is no real shortcut. It is common when using IDL to find
> that you have the data you want but the array is not shaped exactly
> how you need it. The most versatile and efficient solution is to use
> the REFORM function. If it is called with a single argument (the array
> to be reshaped) then it will strip out all unit dimensions. Since the
> number of elements in the array is not being changed you can use the
> OVERWRITE keyword for greater efficiency, thus:
>
> IDL> test_array = reform(test_array, /OVERWRITE)
>
> --
>
> Mark Hadfield
> m.hadfield@niwa.co.nz Ka puwaha et tai nei
> http://katipo.niwa.co.nz/~hadfield Hoea tatou
> National Institute for Water and Atmospheric Research (NIWA)
>
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: FIND the indexes of a value in a matrix
Next Topic: Transparent texture mapped polygons

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

Current Time: Sat Oct 11 01:31:20 PDT 2025

Total time taken to generate the page: 1.11635 seconds