IDL中数组动态扩展的方法

IDL作为一种完全面向矩阵的动态语言,数组是其最基本的结构,在IDL中可直接对数组进行扩展,这在C#和Java这类编译型语言中,是无法做到的。在C#和Java中实现动态数据结构,往往需要用到List,Array,Vector等动态数组封装类,通过这些类中的Add和Delete等方法来对元素进行操作。在IDL中,对数据的动态操作非常方便,数组大小和结构可根据运行候程序的需要自动变化。在数组元素无法确定时,常采用数组合并的方式来动态的扩充数组,同时保持数组原有元素的不变性。数组合并的运算符为“[ ]”,关于“[ ]”操作符,IDL帮助中描述如下:

[ ]:Array concatenation
The expression [A,B] is an array formed by concatenating A and B, which can be scalars or arrays, along the first dimension.

To concatenate second and third levels, nest the brackets; [[1,2],[3,4]] is a 2-element by 2-element array with the first row containing 1 and 2 and the second row containing 3 and 4. Operands must have compatible dimensions; all dimensions must be equal except the dimension that is to be concatenated, e.g., [2,INTARR(2,2)] are incompatible.
Eg:
Define C as three-point vector:
C = [0, 1, 3]
Add 5 to th

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值