更新时间:2021-08-30 23:00:06
我使用
I solved it using the sub2ind function:
sub2ind
A(sub2ind(size(A), 1:numel(a), a')) = 1
为矩阵的每一行设置特定列的值