Using an array for in array indexing

前端 未结 0 1052
南旧
南旧 2020-11-28 00:03

Is there a nicer way to do this?

a = rand(10,10)
a[[CartesianIndex(i,i) for i in 1:10]] .= something

I.e. using setindex! without a Car

相关标签:
回答
  • 消灭零回复
提交回复
热议问题