Reinforcement Learning Example - Pendulum Controller w/ Animation
Version 1.0.0.0 (5.25 KB) by
Matthew Sheen
Q-Learning how to swing and balancing a pendulum. Well-commented code with animation as it runs.
Video here: https://www.youtube.com/watch?v=YLAWnYAsai8
Implementation of the Q-learning algorithm. Learns a controller for swinging a pendulum upright and balancing it. Animates the entire process -- you can watch the system explore the state space and begin to get an idea of "good" and "bad" regions. Well-commented code meant to help explain the process. Lots of settings to play with and observe the results!
Cite As
Matthew Sheen (2026). Reinforcement Learning Example - Pendulum Controller w/ Animation (https://github.com/mws262/MATLAB-Reinforcement-Learning-Pendulum), GitHub. Retrieved .
MATLAB Release Compatibility
Created with
R2014b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- AI and Statistics > Statistics and Machine Learning Toolbox >
- AI and Statistics > Deep Learning Toolbox >
- MATLAB > Graphics > 2-D and 3-D Plots > Animation >
- Physical Modeling > Simscape Multibody > Multibody Modeling > Assembly >
Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Versions that use the GitHub default branch cannot be downloaded
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
|
To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.
