Need help inserting numbers randomly into a matrix

2 ビュー (過去 30 日間)
Austin
Austin 2014 年 3 月 11 日
回答済み: dpb 2014 年 3 月 11 日
part of my project requires me to insert a random number of pegs onto a "board" of zeros with size determined by the player Right now the player is able to determine the columns rows and max number of pegs the program picks a random number of pegs but I need help with how to place that number of pegs with a randomly chosen -1 or 1 value randomly on the board Thanks in advance

採用された回答

dpb
dpb 2014 年 3 月 11 日
doc randperm % I'll leave you to determine how that helps... :)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by