Table of Contents
IndexToBitMask
IndexToBitMask(NF, IndexList) generates a BitMask represented by a string with NF characters and those at position in IndexList equal to '1'.
Input
-
NF : Integer
-
IndexList : Table of integers in the range [0,…,NF-1]
Output
-
a string of 0's and 1's of length NF with all characters at the position in IndexList equal to '1' and the others to '0'.
Example
### p###
Input
- Example.Quanty
BitMask = IndexToBitMask(15,{0,1,2}) print(BitMask)
Result
111000000000000