%%%%%%%%%%%
clear
close all


for essai=1:4

file=sprintf('/Users/florentmathieu/Travail/Fond/fond_essai%i',essai);

load(file)

[center,radius(essai),residuals] = spherefit(X,Y,Z);

residuals=reshape(residuals,size(X));

figure
surf(X,Y,Z,residuals)
axis equal
colorbar
colormap hot
shading interp
view(-40,40)
saveas(gcf, sprintf('verifsphere_%i.eps', essai), 'psc2')

end

radius