% So you want to invert your data for a pair correlation function. % Good luck! % However, if you choose to do it implicitly you are going to need to scale % your length cut-off. This is always a fun procedure, so this spiffy % little graphing package aims to help you on your way. % It plots error versus value of D. % To call it, give it the data, the range you want to scan for minima and the % number of points you feel it should evaluate along the way. function [n] = find_best_d(data,min_d, max_d, num_point) num_point = ceil(num_point); vals = zeros(num_point+1,2); for i=1:num_point+1 vals(i,1) = min_d+(max_d-min_d)*(i-1.0)/num_point ; vals(i,2) = err(data,vals(i,1)); i end plot(vals(:,1), vals(:,2)); vals