How can I get elegantly an upper triangle random matrix (0 elsewhere)?
3 ビュー (過去 30 日間)
古いコメントを表示
I have seen the triu and tril functions, but I can't use them to set to 0:
A = rand(4);
tril(A)=0; % won't work
any idea, other than using 2 for loops?
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Operating on Diagonal Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!