Index "ii" is only selecting the last metric (EMD), as being "ii = length(metrics)". It should be "ii= 1:length(metrics)" instead. Here is the pull request with the changes: https://github.com/cvzoya/saliency/pull/4