MaxMean Distance

This function calculates the MaxMean Distance of two vectors (or recursively rows of matrices).
120 Downloads
Updated 22 May 2015

View License

% May 22nd, 2015 (150522): Reza Farrahi Moghaddam
%
% Syntax: [MaxMean_Distance_Result] = MaxMean_Distance_R(input_vector_1, input_vector_2)
%
% The MaxMean_Distance_R.m calculates the MaxMean Distance of two vectors
% (or recursively rows of matrices). The MaxMean Distance is defined as the
% mean of two distances: i) The average Euclidean distance between the two
% vectors (per dimension) and ii) The maximum absolute difference between
% elements of the two vectors.
%
%
% Examples:
% v1 = [1, 2, 20];
% v2 = [3, 3, 3];
% [MaxMean_Distance_Result] = MaxMean_Distance_R(v1, v2)
% (1 / numel(v1)) * sqrt(sum((v1 - v2) .^ 2))
%
% v1 = [1, 2, 20];
% v2 = [3, 3, 3; 4, 5, 6];
% [MaxMean_Distance_Result] = MaxMean_Distance_R(v1, v2)
%
% v1 = [1, 2, 20; 1, 3, 19];
% v2 = [3, 3, 3];
% [MaxMean_Distance_Result] = MaxMean_Distance_R(v1, v2)
%
% v1 = [1, 2, 20; 1, 3, 19];
% v2 = [3, 3, 3; 4, 5, 6];
% [MaxMean_Distance_Result] = MaxMean_Distance_R(v1, v2)
%

Cite As

Reza Farrahi Moghaddam (2024). MaxMean Distance (https://www.mathworks.com/matlabcentral/fileexchange/50951-maxmean-distance), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0