the dimension of array [message #27303] |
Tue, 16 October 2001 20:09  |
web
Messages: 24 Registered: March 2001
|
Junior Member |
|
|
Hi, I ofter use the following operation:
a=fltarr(10,10,10) is a 3-d array,
if I set
b=a(0,*,*), it is still a 3-d array. But I hope b is a 2-d
array. How can I do then?
best,
jiali
|
|
|
Re: the dimension of array [message #28054 is a reply to message #27303] |
Thu, 15 November 2001 13:41  |
hradilv.nospam
Messages: 19 Registered: November 2001
|
Junior Member |
|
|
Or you can declare b ahead of time:
b = fltarr(10,10)
b[*,*] = a[0,*,*]
On Thu, 15 Nov 2001 22:06:18 +0100, Alexander Rauscher
<e9121161@stud4.tuwien.ac.at> wrote:
>
>
> On Wed, 17 Oct 2001, jiali wrote:
>
>> Hi, I ofter use the following operation:
>> a=fltarr(10,10,10) is a 3-d array,
>> if I set
>> b=a(0,*,*), it is still a 3-d array. But I hope b is a 2-d
>> array. How can I do then?
>>
>> best,
>> jiali
>
> c=reform(b,10,10)
>
>
|
|
|
Re: the dimension of array [message #28055 is a reply to message #27303] |
Thu, 15 November 2001 13:06  |
Alexander Rauscher
Messages: 9 Registered: August 2001
|
Junior Member |
|
|
On Wed, 17 Oct 2001, jiali wrote:
> Hi, I ofter use the following operation:
> a=fltarr(10,10,10) is a 3-d array,
> if I set
> b=a(0,*,*), it is still a 3-d array. But I hope b is a 2-d
> array. How can I do then?
>
> best,
> jiali
c=reform(b,10,10)
|
|
|