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: dpca_explainedVariance.m
    path of file: ./repos/dPCA/matlab
    
    the code of the file until where you have to start completion: function explVar = dpc
    
function was supplied
% with PCA axes instead of dPCA encoder/decoder. In this case it will not
% return the dPCA explained variance.
if max(abs(explVar.cumulativePCA-explVar.cumulativeDPCA)) < 1e-10
    explVar.cumulativeDPCA = [];
end

% OPTIONAL part : OLD APPROACH
if ~isempty(options.X_trial) && ~isempty(options.numOfTrials)
    
    % subtract two trials in each condition to get a sample of noise data
    dims = size(options.X_trial);
    neuronsConditions = options.numOfTrials(:);
    
    ind1 = zeros(1, length(neuronsConditions));
    ind2 = zeros(1, length(neuronsConditions));
    for i=1:length(neuronsConditions)
        tmp = randperm(neuronsConditions(i), 2);
        ind1(i) = tmp(1);
        ind2(i) = tmp(2);
    end