cls_MeanClassFeatures.m 452 Bytes
function S = cls_MeanClassFeatures(F, T)
%Calculates the mean set of features for each class given the feature matrix F and targets T

C = unique(T);                          %get the class IDs
nc = length(C);

S = zeros(nc, size(F, 2));              %allocate space for the mean feature vectors
for c = 1:nc                            %for each class
    S(c, :) = mean(F(T == C(c), :));    %calculate the mean feature vector for class c
end
	
S = S';