How to fit a cylinder to scattered 3D XYZ point data in MATLAB?
问题 I was wondering if it was possible for someone to provide me with some code examples for working with scattered XYZ point data in MATLAB Curve Fitting Toolbox? I would like to fit a surface to points that approximate a cylinder. Thanks. 回答1: In Matlab R2015b and above, You can use pcfitcylinder to fit a cylinder to a pointCloud object. Let's start with producing an example data to see how it works: [theta, r, h] = meshgrid(0:.1:6.28, 1, 0:.2:4); % making a cylinder r = r + 0.05 * randn(size(r