You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: getOverallFitness.m
    path of file: ./repos/CanlabCore/CanlabCore/OptimizeDesign11/core_functions
    
    the code of the file until where you have to start completion: function [overallFitness,mostFit,f] = getOverallFitness(cbalColinPowerWeights,fitnessMatrix)
% function [overallFitness,mostFit,f] = getOverallFitness(cbalColinPowerWeights,fitnessMatrix)
%

    
function [overallFitness,mostFit,f] = getOverallFitness(cbalColinPowerWeights,fitnessMatrix)
% function [overallFitness,mostFit,f] = getOverallFitness(cbalColinPowerWeights,fitnessMatrix)
%
%
% Tor Wager, 11/17/01

   	% Determine overall fitness
   	for i = 1:size(cbalColinPowerWeights,2)				% convert to z scores
      if not(sum(fitnessMatrix(i,:)) == 0)              % only for rows with > 0 weight
         if std(fitnessMatrix(i,:)) == 0
            % disp(['Warning: All fitness scores for row ' num2str(i) ' are the same. Sum ' num2str(sum(fitnessMatrix(i,:)))])
            zfitnessMatrix(i,:) = (fitnessMatrix(i,:) - mean(fitnessMatrix(i,:))) / 1;
         else
      		zfitnessMatrix(i,:) = (fitnessMatrix(i,:) - mean(fitnessMatrix(i,:))) / std(fitnessMatrix(i,:));      
         end