help me with a simple program
显示 更早的评论
I don't know much about matlab so Im hoping for some help from u guys
I must create 1 dice that has 4 faces and roll it the results should be :
1=right
2=left
3=up
4=down
totally random and must be done 50 times plz reply :)
1 个评论
Jan
2015-4-6
Please post more details. What exactly does "create" mean here? A 3D visualization? A function which replies random numbers?
采纳的回答
更多回答(3 个)
Image Analyst
2015-4-6
Use randi():
rolls = randi(4, 1, 50)
2 个评论
Tarek Alnajjar
2015-4-6
Image Analyst
2015-4-6
Sounds like homework, so all three of us gave you the identical hint. And it looks like Mahdiyar gave you a full answer that is what I think you are asking for.
类别
在 帮助中心 和 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!