close all

name = 'Z37';

twoChannels = true;

onVoltage = 7000;
frequency = 0.5;
cycles = 10;


nV = length(onVoltage);
nF = length(frequency);
nC = length(cycles);
n = max([nV, nF, nC]);

for i = 1:n
    if(nV == n)
        v = onVoltage(i);
    else
        v = onVoltage(1);
        if nV > 1
            warning('n doesn''t match')
        end
    end
    if(nF == n)
        f = frequency(i);
    else
        f = frequency(1);
        if nF > 1
            warning('n doesn''t match')
        end
    end
    if(nC == n)
        c = cycles(i);
    else
        c = cycles(1);
        if nC > 1
            warning('n doesn''t match')
        end
    end
    
    
    runHV(highVoltageControlSession, controlFrequency, f, v, c, name, twoChannels);
end