creating matrix of 1 nd -1
1 回表示 (過去 30 日間)
古いコメントを表示
how can i generate random matrix of 1 and -1 ...
thanks in advance
2 件のコメント
Thomas
2012 年 3 月 21 日
Do you want the elements of the matrix to be only 1 and -1 or between 1 and -1
回答 (2 件)
David Young
2012 年 3 月 21 日
Assuming that you want values of 1 and -1 only, you can do
2*randi(2, m, n) - 3
参考
カテゴリ
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!