elec_fit_sphere

# elec_fit_sphere - function[r,x,y,z =...

This preview shows pages 1–2. Sign up to view the full content.

function [r,x,y,z] = elec_fit_sphere(X,Y,Z,xo,yo,zo,estim) % elec_fit_sphere - find radius of sphere and closest spherical points to XYZ % % Usage: [r,x,y,z] = elec_fit_sphere(X,Y,Z,xo,yo,zo) % % Notes: The general formula for a sphere, with radius r is given by: % % (x - xo)^2 + (y - yo)^2 + (z - zo)^2 = r^2 % % This function takes arguments for cartesian co-ordinates % of X,Y,Z (assume Z > 0) and the center of the sphere (xo,yo,zo). % If (xo,yo,zo) are not provided, they are assumed (0,0,0). % % Returns values are the radius 'r' and the (x,y,z) Cartesian % co-ordinates for the fitted sphere. % % See also, elec_sphere_project.m % % \$Revision: 1.1 \$ \$Date: 2009/04/28 22:13:55 \$ % Licence: GNU GPL, no implied or express warranties % History: 06/01 Darren.Weber_at_radiology.ucsf.edu % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % initialise centroid, unless input parameters defined if ~exist('xo','var') xo = 0; else, if isempty(xo) xo = 0; end, end if ~exist('yo','var') yo = 0; else, if isempty(yo) yo = 0; end, end

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

elec_fit_sphere - function[r,x,y,z =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online