Halcon基础(1)Tuple数组操作

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shenseyoulan/article/details/81298886

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]

* 批量给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)

 

展开阅读全文

没有更多推荐了,返回首页