Machine learning - balancing a stack of balls
A genetic algorithm is used to train a neural network controller to balance a stack of balls by applying a lateral force and a torque to the bottom ball. The capsim physics engine is used to produce a realistic simulation for each attempt. It can learn up to 4 balls.
http://www.youtube.com/watch?v=c4vADjwOFNc
Cite As
Peter Bone (2026). Machine learning - balancing a stack of balls (https://ch.mathworks.com/matlabcentral/fileexchange/36911-machine-learning-balancing-a-stack-of-balls), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- AI and Statistics > Statistics and Machine Learning Toolbox >
- AI and Statistics > Deep Learning Toolbox >
Tags
Acknowledgements
Inspired by: CapSim - the MATLAB physics engine, export_fig
Inspired: Machine learning - PushBall game
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.