chi2_beamfits Calculates the chi2 value for the 2d guassian fits
0001 function [chisqrd] = chi2_beamfits(par, X, ydata) 0002 %chi2_beamfits Calculates the chi2 value for the 2d guassian fits 0003 0004 z = gauss2D_fit(par,X); 0005 0006 chi2= ((ydata - z).^2)./z; 0007 chisqrd = nansum(chi2); 0008 0009 end 0010