function averatio=radgrad(n) %This function takes in an array of numbers of particles in four bins %and calculates r*dc/dr based on the experimental observations of Karnis, %Goldsmith & Mason. %We have the concentrations: ntotal=sum(n); c=4*0.33*n/ntotal; %We have the derivatives: npt=length(c); dcdr=(c(2:npt)-c(1:npt-1))/0.1; %We have the radial mid points: r=[.1,.2,.3]; %Thus we get the ratios: ratio=r.*dcdr; %and we return the mean: averatio=mean(ratio);