Sphere Fit (least squared)
Version 1.1.0.0 (30.7 KB) by
Alan Jennings
Fits a sphere to a set of noisy data. Does not require a wide arc or many points.
Editor's Note: This file was selected as MATLAB Central Pick of the Week
Given a set of data points, this function calculates the center and radius of the data in a least squared sense. The least squared equations are used to reduce the matrix that is inverted to a 3x3, opposed to doing it directly on the data set. Does not require a large arc or many data points. Assumes points are not singular (co-planar) and real...
Created on R2010b, but should work on all versions.
Cite As
Alan Jennings (2026). Sphere Fit (least squared) (https://se.mathworks.com/matlabcentral/fileexchange/34129-sphere-fit-least-squared), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2010b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Least Squares in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
