% autor: Matouš Přikryl
% thesis: HIL testing of BMS
% code purpose: Graphic function for painting graphs

function xregion(startT, endT, color, max)
    x = [startT startT endT endT];
    y = [0 max max 0];
    if color == 1
        patch(x, y, 'green', 'FaceAlpha', 0.05, 'EdgeColor', 'none')
    else
        patch(x, y, 'red', 'FaceAlpha', 0.5, 'EdgeColor', 'none')
    end
end