how to insert diganole of zeros in to matrix without using loops ?

1 次查看(过去 30 天)
my question is simple how to change the main diagonel of nXn of random numers and change the main diagonle to zeroes ?
without using loops ?

采纳的回答

madhan ravi
madhan ravi 2019-3-3
a(logical(eye(size(a,1))))=0 % where a is your matrix

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by