Converting an array to 0s and 1s

Viewed 80

Suppose I have an array A = [13, 15, 17]. I want to create a new array B such that all entries apart from its 13th, 15th and 17th entries are 0, and each of these three are 1's. How can I do this?

1 Answers
Related