How do I write a for loop for multiple situations?

1 回表示 (過去 30 日間)
Nick Haufler
Nick Haufler 2015 年 9 月 30 日
回答済み: Joseph Cheng 2015 年 9 月 30 日
in the attached document, how do i write loops to determine if theres a pair or five-of-a-kind. Would i set up a vector, and make an element in each vector equal to something? Would really appreciate your help, I can attach my script file for rolling two dice if that would help. I really do appreciate the help you guys have to offer.

採用された回答

Joseph Cheng
Joseph Cheng 2015 年 9 月 30 日
You do not need loops to determine the N-of a kind. If you follow the assignment you should be looking at the sorted array and how many same numbers are adjacent see documentation on diff(). If you can be creative and go away from the method in the assignment look at the function mode()

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by