Halcon基础(1)Tuple数组操作Tuple数组操作:
* 将⼀个Tuple数组赋值给变量
Tuple1 := [1,2,3,4,5,6,7,8,9]
*给Tuple数组元素赋值
Tuple1[1] := 0
* 批量改变数组元素的值
Tuple1[1,3,5] := 'wh'
* 批量给Tuple数组赋值,其值为0到10000连续数值
Tuple3 := [0:100]数组全部赋值为1
* 批量给Tuple数组赋值,其值为3到200连续数值,步长为1
Tuple4 := [3:2:100]
* 批量给Tuple数组赋值,其值为100到-100连续数值,步长为-10
Tuple5 := [100:-10:-100]
* 对两个Tuple数组进⾏合并操作
TupleInt1 := [3,1,2,9,1]
TupleInt2 := [10,2,4,3,2]
tuple_union (TupleInt1, TupleInt2, UnionInt)
* 对两个Tuple数组进⾏交集操作
TupleInt3 := [3,1,2,9,1]
TupleInt4 := [10,2,4,3,2]
tuple_intersection (TupleInt3, TupleInt4, IntersectionInt)
* 对Tuple数组元素进⾏替换
OriginalTuple := [0,1,2,3,4,5]
tuple_replace (OriginalTuple, [0,1], ['x','y'], Replaced)
* 向Tuple数组插⼊数值
OriginalTuple := [0,1,2,3,4,5]
tuple_insert (OriginalTuple, 3, 'x', InsertSingleValueA)

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。