I’ll reiterate that you should absolutely just use
a = view(s,[1,3]) a .= [100,200]
But if you insist on using an array of
Ref then you can write
a = [Ref(s,1),Ref(s,3)] setindex!.(a,[100,200])
PLEASE DO NOT DO THIS. The syntax is awful because this is not how you should do this.