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: RvmOptimization.m
    path of file: ./repos/RVM-MATLAB/RvmModel
    
    the code of the file until where you have to start completion: classdef RvmOptimization < handle
    %{
        CLASS DESCRIPTION

        Parameter optimization for RVM 
    
function accuracy = crossvalFunc(rvm)
            %{
                Compute the cross validation accuracy
            %}
            rng('default')
            rvm_ = copy(rvm);
            data_ = rvm_.data;
            label_ = rvm_.label_;
            rvm_.display = 'off';
            rvm_.evaluationMode = 'train';
            cvIndices = crossvalind(rvm.crossValidation.method, ...
                rvm_.numSamples, rvm.crossValidation.param);
            switch rvm.crossValidation.method
                case 'KFold'
                    accuracy_ = Inf(rvm.crossValidation.param, 1);
                    for i = 1:rvm.crossValidation.param
                        testIndices = (cvIndices == i);
                        testData = data_(testIndices, :);
                        testLabel = label_(testIndices, :);
                        rvm_.data = data_(~testIndices, :);
                        rvm_.label_ = label_(~testIndices, :);
                        try
                            rvm_.getModel;
                        catch
                            continue
                        end