Falling Objects in a GUI

My current GUI has a paddle moving back and forth on the X-aixis, its controlled my an accelerometer. I'm was wondering how would you get a number of falling object starting from the top of the window and fall at random speeds? And the number of falling objects increase with time?

回答 (2 件)

Image Analyst
Image Analyst 2014 年 3 月 8 日

0 投票

MATLAB offers a rand() function to generate random numbers, and various timing functions like tic and toc, and clock() or now(). It should be easy for you to do what you ask if you just use those built in functions.
Walter Roberson
Walter Roberson 2014 年 3 月 8 日

0 投票

image() them into place. Change the image object's xdata and ydata properties to move them.
If you need them to rotate as well, the easiest way would probably be to use a hgtransform to hold the image object.

カテゴリ

ヘルプ センター および File ExchangeObject Containers についてさらに検索

質問済み:

2014 年 3 月 8 日

回答済み:

2014 年 3 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by