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

Home » Public Forums » archive » reform a transposed array
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
reform a transposed array [message #94084] Mon, 16 January 2017 14:13 Go to next message
smnadoum is currently offline  smnadoum
Messages: 24
Registered: June 2016
Junior Member
I am having difficulties reforming a transposed array:
e is int =array[3,1,2]
I transposed e to : int = array[2,1,3]

but now I want to reform e to [4,2]:
e = reform(e,4,2,/overwrite)

I know that this function won't work for reforming the array to [4,2] due to the difference in the number of elements.

Is there a way to reform the array e to [4,2]?

Thanks
Re: reform a transposed array [message #94085 is a reply to message #94084] Mon, 16 January 2017 17:52 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Monday, January 16, 2017 at 5:13:11 PM UTC-5, Cheryl wrote:
> I am having difficulties reforming a transposed array:
> e is int =array[3,1,2]
> I transposed e to : int = array[2,1,3]
>
> but now I want to reform e to [4,2]:
> e = reform(e,4,2,/overwrite)
>
> I know that this function won't work for reforming the array to [4,2] due to the difference in the number of elements.
>
> Is there a way to reform the array e to [4,2]?

The original array has 6 elements. The desired array has 8 elements. There's no way to use REFORM or REBIN to go to a different number of elements like this. You would be better off computing the elements of your desired array explicitly, one by one.
CM
Re: reform a transposed array [message #94086 is a reply to message #94085] Mon, 16 January 2017 18:31 Go to previous message
smnadoum is currently offline  smnadoum
Messages: 24
Registered: June 2016
Junior Member
On Monday, January 16, 2017 at 5:52:51 PM UTC-8, Craig Markwardt wrote:
> On Monday, January 16, 2017 at 5:13:11 PM UTC-5, Cheryl wrote:
>> I am having difficulties reforming a transposed array:
>> e is int =array[3,1,2]
>> I transposed e to : int = array[2,1,3]
>>
>> but now I want to reform e to [4,2]:
>> e = reform(e,4,2,/overwrite)
>>
>> I know that this function won't work for reforming the array to [4,2] due to the difference in the number of elements.
>>
>> Is there a way to reform the array e to [4,2]?
>
> The original array has 6 elements. The desired array has 8 elements. There's no way to use REFORM or REBIN to go to a different number of elements like this. You would be better off computing the elements of your desired array explicitly, one by one.
> CM

Thank you!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: MPMINSTEP in mpfit?
Next Topic: Amoeba and Tied Parameters

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

Current Time: Wed Oct 08 09:10:39 PDT 2025

Total time taken to generate the page: 0.00506 seconds