Skip to content

Instantly share code, notes, and snippets.

@mathsam
Created July 7, 2013 22:46
Show Gist options
  • Save mathsam/5945262 to your computer and use it in GitHub Desktop.
Save mathsam/5945262 to your computer and use it in GitHub Desktop.
function flux1d = calIsenFlux1d(vcomp1d,PT1d,pfull,isenCoordEdge,pInterp)
% unit is not converted into standard using G
vcomp1dInterp = interp1(pfull,vcomp1d, pInterp,'spline','extrap');
PT1dInterp = interp1(pfull,PT1d, pInterp,'spline','extrap');
[~, bin] = histc(PT1dInterp,isenCoordEdge);
flux1d = zeros(length(isenCoordEdge)-1,1);
for i = 1:length(bin)
if bin(i) ~= 0
flux1d(bin(i)) = flux1d(bin(i))+vcomp1dInterp(i);
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment