Generated a MATLAB code, that shows how to create a map of an environment using range sensor readings and robot poses for a differential drive robot. I create a map from range sensor readings that are simulated using the range Sensor object. The differential Drive Kinematics motion model simulates driving the robot around the room based on velocity commands. The range Sensor gives range readings based on the pose of the robot as it follows the path.
You can learn more at the My GitHub Repository.