Skip to content

Instantly share code, notes, and snippets.

@thorade
Last active December 28, 2015 21:49
Show Gist options
  • Save thorade/7567397 to your computer and use it in GitHub Desktop.
Save thorade/7567397 to your computer and use it in GitHub Desktop.
Matlab function to calculate the log-mean of scalars or arrays
function m=logmean(a,b)
if abs(b-a)>1e-3
m=(b-a)./log(b./a);
else
m=(a+b)./2;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment