- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Estimation/Discrete/ModeEstimationPerformance/test/getMeanVar.m

    00001 function  = getMeanVar(data, compVec)
    00002
    00003 %-------------------------------------------------------------------------------------------
    00004 % Computes the mean and variance for each element in compVec
    00005 %
    00006 % [meanVar] = getMeanVar(data, compVec)
    00007 %
    00008 %   where   data is the vector of timing data
    00009 %           are the # of conflicts or faults to compare data to
    00010 %
    00011 %
    00012 % Oliver Martin
    00013 % June 3, 2004
    00014 %-------------------------------------------------------------------------------------------
    00015
    00016 if(nargin ~= 2)
    00017     disp(['There should be two arguments']);
    00018     return
    00019 end
    00020
    00021 index = 1;
    00022
    00023 maxVal = max(compVec);
    00024
    00025 for i=0:maxVal
    00026     vals = ;
    00027     for j=1:length(compVec)
    00028         if compVec(j) == i
    00029             vals(length(vals)+1)= data(j);
    00030         end
    00031     end
    00032     if length(vals) > 0
    00033         meanVar(index,1) = i;
    00034         meanVar(index,2) = mean(vals);
    00035         meanVar(index,3) = std(vals);
    00036         index = index + 1;
    00037     end
    00038 end