IDL transpose: perfusion arrays

Examples


See Additional Examples for more information on using TRANSPOSE.

Example 1

Print a simple array and its transpose by entering:

; Create an array:
A = INDGEN(3,3)
TRANSA = TRANSPOSE(A)
; Print the array and its transpose:
PRINT, 'A:'
PRINT, A
PRINT, 'Transpose of A:'
PRINT, TRANSA

IDL prints:

A:
   0  1  2
   3  4  5
   6  7  8
 
Transpose of A:
   0  3  6
   1  4  7
   2  5  8

Syntax


Result = TRANSPOSE( Array [, P] )

Return Value


Returns the reflection of the array along a diagonal.

Arguments


Array

The array to be transposed.

P

A vector specifying how the dimensions of Array will be permuted. The elements of P correspond to the dimensions ofArray; the ith dimension of the output array is dimension P[i] of the input array. Each element of the vector P must be unique. Dimensions start at zero and can not be repeated.

If P is not present, the order of the dimensions of Array is reversed.

Keywords


None.

Additional Examples


Example 2

This example demonstrates multi-dimensional transposition:

; Create the array:
A = INDGEN(2, 3, 4)
; Take the transpose, reversing the order of the indices:
B = TRANSPOSE(A)
; Re-order the dimensions of A, so that the second dimension
; becomes the first, the third becomes the second, and the first
; becomes the third:
C = TRANSPOSE(A, [1, 2, 0])
; View the sizes of the three arrays:
HELP, A, B, C

IDL prints:

A   INT  = Array[2, 3, 4]
B   INT  = Array[4, 3, 2]
C   INT  = Array[3, 4, 2]
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值