Adding zeros in the empty places in a matrix.
3 次查看(过去 30 天)
显示 更早的评论
采纳的回答
KSSV
2021-11-12
A = rand(252,1) ;
iwant = zeros(252,1) ;
idx = [1 13 25 73 121 109 97 61] ;
iwant(idx) = A(idx) ;
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!