How to show repeated graphics as program runs

11 ビュー (過去 30 日間)
Jonathan Pulman
Jonathan Pulman 2013 年 11 月 21 日
コメント済み: Jonathan Pulman 2013 年 11 月 22 日
I am writing a program to run the prisoners dilemma game. The idea is to run many iterations, selecting the best players. I would like to use a graphics figure to show the result of a series of games, then continue running while the figure is still displayed, then show the results of the next series of games when they are completed and so on.
When I have code written in the program to display the results, the program continues to run but the figure does not get get displayed. If I click on the tab (? correct term) at the bottom of the screen to show the figure, the program stops running.
Any suggestions?

採用された回答

Walter Roberson
Walter Roberson 2013 年 11 月 21 日
After you have completed one set of updates and want the changes displayed on the screen, insert the command
drawnow()
  1 件のコメント
Jonathan Pulman
Jonathan Pulman 2013 年 11 月 22 日
Thanks; I also used waitforbuttonpress which makes it go nicely.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumber games についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by