Tutorial code on particle filtering for 1D
Updated 22 Apr 2015

View License

Particle filter example in 1D. "MCLin1Dsimple" implements Monte-Carlo Localization in one Dimension.
Simulates particle filtering in 1D using MCL algorithm (table 8.2) from
"Probabilistic Robotics", (Intelligent Robotics and Autonomous Agents
series) Hardcover – August 19, 2005 by Sebastian Thrun, Wolfram Burgard,
Dieter Fox.
This simple implementation is designed for teaching. It has pauses, and
you must press a key to step through the simulation. Displays the particles before moving in blue (with a histogram), the actual position after moving with a red line, the measurement with a magenta line, the particles propagated forward by the motion model and weighted according to the measurement in black, and the resampled particles in red (with a histogram).

Aaron T. Becker, University of Houston

Cite As

Aaron T. Becker's Robot Swarm Lab (2024). MCLin1Dsimple (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Genomics and Next Generation Sequencing in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Try changing the number of particles, or switching the sampling method.