setElems question

270
1
02-11-2022 12:29 PM
Clover4
New Contributor II

Using  version "2021.1".

Trying to use the setElems function but not having success.   I want to use setElems to change the value in an array to a new value.  When I use setElems in a rule it says "undefined rule".  

My array is set up like so:

attr Array1D = [0,0,0,0]

Rule-->
setElems(Array1D,0,5)

Thanks in advance!!

0 Kudos
1 Reply
Hadi_yousefi
New Contributor III

hi Brain - this way you can use

attr Array1D = [0,0,0,0]

A =setElems(Array1D,0,5)


Rule-->
print(A)

0 Kudos