need help on my matrix code
显示 更早的评论
so pretty much i am creating minesweeper, and i created a random 10x10 matrix( mine_probabilities = rand(10) ) and then another matrix, mine(10,10) = 0 for the minefield
if the any number in rand(10) is >= .85 then the mine(m,n) = 1 ( which means there is a mine) if not mine(m,n) = 0 (no mine).
I am not sure why this is not working any help??
mine_probabilities = rand(10);
mine(10,10) = 0;
if mine_probabilities >= .85
mine = 1;
else
mine() = 0;
end
disp(mines)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!