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: B_BatchSize.m
    path of file: ./repos/Swan/VariAuto/Analysis
    
    the code of the file until where you have to start completion: clear;clc;close all;addpath ../Codes;

%% INITIALIZATION
% Data
data          = Data('../Datasets/MNIST.csv',30,1);
% Network
hiddenlayers = [500,150];
structure    = [data.nFeatures,hiddenlayers,data.
    
function value
% opt.time          = Inf([1,1]);  
% opt.fv            = 0.01;

%% BATCH ANALYSIS
optType     = ["SGD","Nesterov","RMSProp"];
batch       = [1 5 10 50 100 200 500 1000 2000 4000 8000];
l           = 10;
historyFV   = zeros([l,length(batch),length(optType)]);
historyTE   = zeros([l,length(batch),length(optType)]);
historyTIME = zeros([l,length(batch),length(optType)]);

for k = 1:length(optType)
    for i = 1:length(batch)
        optimizer = Trainer.create(network,optType(k),learningRate,momentum(k),batch(i),opt,'static');
        for j = 1:l
        network.computeInitialTheta();
        optimizer.train();
        
        historyTIME(j,i,k) = toc;
        [~,y_pred]         = max(network.getOutput(data.Xtest),[],2);
        [~,y_target]       = max(data.Ytest,[],2);
        testError          = mean(y_pred ~= y_target);
        historyFV(j,i,k)   = network.cost;
        historyTE(j,i,k)   = testError;
        fprintf('%d %d TE %f\n',i,j,historyTE(j,i))
        if j >= 3
            if mean(historyTIME(1:j,i,k), 1) > 950
                historyTIME(j+1:end