Last active
December 28, 2015 21:49
-
-
Save thorade/7567397 to your computer and use it in GitHub Desktop.
Matlab function to calculate the log-mean of scalars or arrays
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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