-1

For example, I would like to get the position of null in the following vector.

a=1 NULL 2 3 6 NULL 2 NULL

I have tried the following script:

re=isNull(a)
index=array(int,0,1)
for(i in 1..size(a)){
    if(re[i]==true){
        index.append!(i)
        }
    }
print index

But the performance is poor when the vector is large, is there any other ways?

Summer.H
  • 99
  • 1
  • 7

1 Answers1

0

Try the code below

at(a==NULL)
Davis Zhou
  • 353
  • 4
  • 6