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

Home » Public Forums » archive » Re: from array to one dimentional 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
Re: from array to one dimentional array [message #45501] Tue, 13 September 2005 10:12
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Timm Weitkamp writes:

> Or simply,
>
> array = array[*]

Yes, but this is not likely to enlighten an IDL newby. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: from array to one dimentional array [message #45502 is a reply to message #45501] Tue, 13 September 2005 09:42 Go to previous message
Timm Weitkamp is currently offline  Timm Weitkamp
Messages: 66
Registered: August 2002
Member
David Fanning wrote:
> steffenfr writes:
>
>> Dear all, I am trying to apply the spearman correlation
>> coefficient to 2 images which means that I have to compare
>> 2 arrays. The R_correlate however works only with one dimentional
>> arrays which means that I need to change the n-dimentional array into a
>> one-dimentional one, for example like that
>>
>> Array: 3by3
>>
>> 111
>> 222
>> 333
>>
>> into the one-dimentianl array (Vector) [9by1] which is [111222333]
>>
>> Does anybody know how do do that in a simple way, or has anybody done
>> it alreay in a program?
>
> I would try REFORM:
>
> s = Size(array, /Dimensions)
> array = Reform(array, s[0]*s[1])

Or simply,

array = array[*]

Cheers,
Timm

Timm Weitkamp, ESRF, Grenoble, France
Re: from array to one dimentional array [message #45504 is a reply to message #45502] Tue, 13 September 2005 09:10 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
steffenfr writes:

> Dear all, I am trying to apply the spearman correlation
> coefficient to 2 images which means that I have to compare
> 2 arrays. The R_correlate however works only with one dimentional
> arrays which means that I need to change the n-dimentional array into a
> one-dimentional one, for example like that
>
> Array: 3by3
>
> 111
> 222
> 333
>
> into the one-dimentianl array (Vector) [9by1] which is [111222333]
>
> Does anybody know how do do that in a simple way, or has anybody done
> it alreay in a program?

I would try REFORM:

s = Size(array, /Dimensions)
array = Reform(array, s[0]*s[1])

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: no drag events in cw_fslider or widget_slider
Next Topic: Force Field

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

Current Time: Fri Oct 10 11:57:03 PDT 2025

Total time taken to generate the page: 1.27934 seconds