https://it.mathworks.com/help/vision/ref/pcfitcylinder.html
pcfitcylinder - Fit cylinder to 3-D point cloud - MATLAB
This MATLAB function fits a cylinder to a point cloud with a maximum allowable distance from an inlier point to the cylinder.
point cloudfitcylindermatlab