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: averageSVM.m
    path of file: ./repos/erplab/functions
    
    the code of the file until where you have to start completion: function [mvpc] = averageSVM(mvpc, smoothing)

% Create the decoding accuracy at each time point (averaged over classes) 

Nblock = mvpc.nCrossfolds;
Nitr = mvpc.nIter; 

    
function [mvpc] = averageSVM(mvpc, smoothing)

% Create the decoding accuracy at each time point (averaged over classes) 

Nblock = mvpc.nCrossfolds;
Nitr = mvpc.nIter; 
Ntp = length(mvpc.times); 
Nclasses = mvpc.nClasses;
Nruns = Nblock*Nitr;
%chancelvl = 1/Nclasses; 

DecodingAccuracy = nan(Ntp,Nruns);
Coded_Predictions = nan(Ntp,Nruns,Nclasses); 
% We will compute decoding accuracy per subject in DecodingAccuracy,
% enter DecodingAccuracy into AverageAccuray, then overwrite next subj.

%% load SVM_ECOC output files

%if classcoding == 2 %1vAll
% Obtain predictions from SVM-ECOC model
svmPrediction = squeeze(mvpc.raw_predictions);
% tstTargets = squeeze(ALLMVPA(seta).targets);


TrueAnswer = reshape([1:Nclasses],[Nclasses,1]);


for r = 1:Nruns
    for tp = 1:Ntp
        prediction = squeeze(svmPrediction(tp,r,:));
        Err = TrueAnswer - prediction;
        ACC = mean(Err == 0);
        coded = Err == 0;
        DecodingAccuracy(tp,r) = ACC;
        Coded_Predictions(tp,r,:) = coded;
        
        
        
    end