Fit q-profile by F-X Duthoit (CEA/DSM/IRFM, francois-xavier.duthoit@cea.fr) and R. Goupillou (CEA/DSM/IRFM, romain.goupillou@cea.fr)
0001 function [qmin,qmax,eq,qopt,chi2] = fit_qprofile_fxdrg(rho,q) 0002 % 0003 % Fit q-profile 0004 % 0005 % by F-X Duthoit (CEA/DSM/IRFM, francois-xavier.duthoit@cea.fr) and R. Goupillou (CEA/DSM/IRFM, romain.goupillou@cea.fr) 0006 % 0007 qopt = 1;%from LUKE reference 0008 qmin = min(q); 0009 qmax = max(q); 0010 % 0011 [eq,chi2] = fminsearch(@(x) sum((q - ((qmax - qmin).*rho.^x + qmin)).^2),1);